summaryrefslogtreecommitdiff
path: root/app/controllers/authenticated_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/authenticated_controller.rb')
-rw-r--r--app/controllers/authenticated_controller.rb6
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