Skip to content

Commit c80cf7a

Browse files
committed
Revert most changes to decrypt
1 parent caa9b4f commit c80cf7a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/models/user.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def token=(value)
4242
end
4343

4444
def token
45-
crypt.decrypt_and_verify(self[:token]) if self[:token]
45+
encrypted_token = self[:token]
46+
47+
unless encrypted_token.nil?
48+
crypt.decrypt_and_verify(encrypted_token)
49+
end
4650
end
4751

4852
def payment_gateway_subscription

app/models/violation.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ def source=(value)
2020
end
2121

2222
def source
23-
crypt.decrypt_and_verify(self[:source]) if self[:source]
23+
encrypted_source = self[:source]
24+
25+
unless encrypted_source.nil?
26+
crypt.decrypt_and_verify(encrypted_source)
27+
end
2428
end
2529

2630
private

0 commit comments

Comments
 (0)