summaryrefslogtreecommitdiff
path: root/app/controllers/services
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-02-23 17:29:47 -0600
committerHombreLaser <sebastian-440@live.com>2023-02-23 17:29:47 -0600
commit38d054e178f6860a1e1b3ed160808509c920bcc1 (patch)
tree28dbbf4335fda4002cdf93a5eaff5aa0bf48f22c /app/controllers/services
parent086d711a8d659b6135871cd932651a6d6344ab4c (diff)
Añade servicio para generación de jwts
Diffstat (limited to 'app/controllers/services')
-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