dawarich/app/services/subscription/decode_jwt_token.rb

17 lines
264 B
Ruby
Raw Permalink Normal View History

2025-04-19 07:18:39 -04:00
# frozen_string_literal: true
class Subscription::DecodeJwtToken
def initialize(token)
@token = token
end
def call
JWT.decode(
2025-04-23 16:46:39 -04:00
@token,
2025-04-19 07:18:39 -04:00
ENV['JWT_SECRET_KEY'],
true,
{ algorithm: 'HS256' }
).first.symbolize_keys
end
end