diff options
author | HombreLaser <sebastian-440@live.com> | 2023-03-11 12:10:57 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-03-11 12:10:57 -0600 |
commit | 3dae1ce143d006cc75940b746a8eb74982e6e861 (patch) | |
tree | 5bfa59dfd11bbfc9b8ef2a38da067e0c2ca0da42 /app/controllers/authenticated_controller.rb | |
parent | 6b3cc5c3a33643c0e42396142a2d3204ada2bb82 (diff) |
Añade test de scoping
Diffstat (limited to 'app/controllers/authenticated_controller.rb')
-rw-r--r-- | app/controllers/authenticated_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/authenticated_controller.rb b/app/controllers/authenticated_controller.rb index de02cab..56159ab 100644 --- a/app/controllers/authenticated_controller.rb +++ b/app/controllers/authenticated_controller.rb @@ -13,6 +13,12 @@ class AuthenticatedController < ApplicationController @current_user_account ||= UserAccount.find_by(email:) end + def current_user_role + return if decoded_token.nil? + + decoded_token[0]['aud'] + end + def authentication_token @authentication_token ||= request.headers[:authorization]&.sub(/^Bearer /, '') end |