summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/services/token_generation_service.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/services/token_generation_service.rb b/app/controllers/services/token_generation_service.rb
new file mode 100644
index 0000000..2df2ea6
--- /dev/null
+++ b/app/controllers/services/token_generation_service.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Services
+ # The service responsible for JWT generation.
+ class TokenGenerationService
+ def initialize(params)
+ @email = params[:email]
+ @role = params[:role]
+ end
+
+ private
+
+ def payload
+ { data: @email, aud: @role }
+ end
+ end
+end