dawarich/app/services/subscription/decode_jwt_token.rb
2025-04-23 23:41:11 +02:00

16 lines
264 B
Ruby

# frozen_string_literal: true
class Subscription::DecodeJwtToken
def initialize(token)
@token = token
end
def call
JWT.decode(
@token,
ENV['JWT_SECRET_KEY'],
true,
{ algorithm: 'HS256' }
).first.symbolize_keys
end
end