Create AuthTokenCreator and AuthTokenDecryptor classes

This commit is contained in:
Maciej Szlosarczyk 2018-07-20 15:21:10 +03:00
parent dad57ba528
commit dc8230dcc2
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
8 changed files with 221 additions and 33 deletions

View file

@ -1,5 +1,5 @@
require 'rails5_api_controller_backport'
require 'auth_token'
require 'auth_token/auth_token_creator'
module Api
module V1
@ -32,8 +32,8 @@ module Api
end
def create_token(user)
token = AuthToken.new
hash = token.generate_token(user)
token_creator = AuthTokenCreator.create_with_defaults(user)
hash = token_creator.token_in_hash
hash
end
end