Class: Mutations::Auth::ForgotPassword

Inherits:
GraphQL::Schema::Mutation
  • Object
show all
Defined in:
app/graphql/mutations/auth/forgot_password.rb

Instance Method Summary collapse

Instance Method Details

#resolve(email:) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'app/graphql/mutations/auth/forgot_password.rb', line 12

def resolve(email:)
  user = User.where(locked_at: nil).find_by email: email

  user.send_reset_password_instructions if user.present?

  {
    errors: [],
    success: true,
    valid: true
  }
end