Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to provide authenticated user to context in SignIn and SignUp mutation #222

Open
Vadim-Kurnatovskiy opened this issue Oct 28, 2022 · 0 comments

Comments

@Vadim-Kurnatovskiy
Copy link

Vadim-Kurnatovskiy commented Oct 28, 2022

This error can be reproduced if you request additional policy rules for the user when logging in

module Mutations
  class SignIn < BaseMutation
    argument :input, Types::SignInInput, required: true

    type Types::Payloads::SignInPayload

    def resolve(input:)
      signin_user = SigninUser.call(input.to_h)

      if signin_user.success?
        context[:current_user] = result.user

        signin_user
      else
        execution_error(error_data: signin_user.error_data)
      end
    end
  end
end

co-authored @AnnaAleynik

@Vadim-Kurnatovskiy Vadim-Kurnatovskiy changed the title Need to remove field :me from SignInPayload Need to remove 'field :me' from SignInPayload Oct 28, 2022
@Vadim-Kurnatovskiy Vadim-Kurnatovskiy changed the title Need to remove 'field :me' from SignInPayload Need to provide authenticated user to context in SignIn mutation Oct 28, 2022
@ArthurZaharov ArthurZaharov changed the title Need to provide authenticated user to context in SignIn mutation Need to provide authenticated user to context in SignIn and SignUp mutation Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant