Skip to content

Commit a0b6b11

Browse files
committed
Fix login errors
1 parent 5c746f4 commit a0b6b11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/graphql/mutations/login.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class Login < BaseMutation
1010
argument :webauthn_response, GraphQL::Types::JSON, required: false
1111

1212
def resolve(email:, password: nil, webauthn_response: nil)
13-
user = User.find_by!(email: email)
13+
user = User.find_by(email: email)
14+
raise GraphqlErrors::AuthenticationFailedError, "Invalid email or password" unless user
1415

1516
authenticate!(user:, password:, webauthn_response:)
1617

0 commit comments

Comments
 (0)