Skip to content

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

@Vadim-Kurnatovskiy

Description

@Vadim-Kurnatovskiy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions