1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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