Skip to content

Commit

Permalink
Set global current_user
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez committed Mar 14, 2019
1 parent 8a2b3e2 commit 1b4217c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/graphql/mutations/auth/sign_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def resolve(email:, password:, remember_me:)

if valid_sign_in
generate_access_token(user, response)
set_current_user_token(user, context)
set_current_user(user)
remember_me ? set_refresh_token(user, response) : delete_refresh_token(user)

{
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/graphql/token_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def set_refresh_token(user, response)
response.set_header 'RefreshToken', refresh_token
end

def set_current_user_token(user, context)
def set_current_user(user)
context[:current_user] = user
end

Expand Down

0 comments on commit 1b4217c

Please sign in to comment.