mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
fixed codeclimate errors (partically)
This commit is contained in:
parent
3f41ce4ab4
commit
f4e0084895
103 changed files with 339 additions and 367 deletions
|
@ -1,9 +1,7 @@
|
|||
class AuthTokenCreator
|
||||
DEFAULT_VALIDITY = 2.hours
|
||||
|
||||
attr_reader :user
|
||||
attr_reader :key
|
||||
attr_reader :expires_at
|
||||
attr_reader :user, :key, :expires_at
|
||||
|
||||
def self.create_with_defaults(user)
|
||||
new(user, Rails.application.config.secret_key_base, Time.now + DEFAULT_VALIDITY)
|
||||
|
@ -24,7 +22,7 @@ class AuthTokenCreator
|
|||
end
|
||||
|
||||
def encrypted_token
|
||||
encryptor = OpenSSL::Cipher::AES.new(256, :CBC)
|
||||
encryptor = OpenSSL::Cipher.new('aes-256-cbc')
|
||||
encryptor.encrypt
|
||||
|
||||
# OpenSSL used to automatically shrink oversized keys, it does not do that any longer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue