diff options
author | HombreLaser <sebastian-440@live.com> | 2023-03-03 20:58:25 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-03-03 20:58:25 -0600 |
commit | 898d91cca5721db785e991e0eab9f05010925b1a (patch) | |
tree | 46f8733de6fffabdd92c152308d0aee27f2d2d8e /app | |
parent | e3b19598c75790758995f9db206427135d6851c2 (diff) |
Reacomoda directorio de specs
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/token_generation_concern.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/app/controllers/concerns/token_generation_concern.rb b/app/controllers/concerns/token_generation_concern.rb deleted file mode 100644 index beab467..0000000 --- a/app/controllers/concerns/token_generation_concern.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# Common logic for all the logics that require the token generation -# service. -module TokenGenerationConcern - extend ActiveSupport::Concern - - def service - @service ||= Services::TokenGenerationService.new(service_params) - end - - def generate_user_session_key(user) - user.update_attribute(:session_key, SecureRandom.hex(16)) - end - - def generate_token - { token: service.call(DateTime.current + 30.minutes), refresh: service.call(DateTime.current + 3.days) } - end - - def service_params - { email: @user_account.email, role: @user_account.role, session_key: @user_account.session_key } - end -end |