Skip to content

Exceptions thrown in ConvexCredentials.authorize() are unhandled #65

Open
@doublemarked

Description

@doublemarked

Overview

Exceptions (including ConvexError) are unhandled when thrown from a ConvexCredentials.authorize() method.

Setup

export const { auth, signIn, signOut, store } = convexAuth({
	providers: [
		ConvexCredentials({
			id: 'simple-auth',
			authorize: async () => {
				throw new ConvexError('Testing for @sshader')
			},
		}),
	],
})

Outcome

Screenshot 2024-09-03 at 9 51 44 PM

Expected outcome

At minimum, the exception should be caught by Convex. But ideally, throwing an exception from authorize() should bubble up to the client side so that the client can handle the error. We should be able to use exceptions or some other mechanism to communicate failure conditions to the client during authorize() in order to better control the authorization process.

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