add jwt authentication on graphql controller
This commit is contained in:
15
app/services/auth/profile.rb
Normal file
15
app/services/auth/profile.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
module Auth
|
||||
class Profile
|
||||
attr_reader :id, :email
|
||||
|
||||
def initialize(attributes)
|
||||
@id = attributes[:sub]
|
||||
@email = attributes[:email]
|
||||
end
|
||||
|
||||
def customer
|
||||
@customer ||= Customer.find_by(email: email, auth_id: id)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user