mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-30 10:56:31 -05:00
feat(passkey): error codes in passkey client (#3966)
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com> Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,7 @@ export const getPasskeyActions = (
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
code: "AUTH_CANCELLED",
|
||||
message: "auth cancelled",
|
||||
status: 400,
|
||||
statusText: "BAD_REQUEST",
|
||||
@@ -140,6 +141,7 @@ export const getPasskeyActions = (
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
code: e.code,
|
||||
message: "previously registered",
|
||||
status: 400,
|
||||
statusText: "BAD_REQUEST",
|
||||
@@ -150,6 +152,7 @@ export const getPasskeyActions = (
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
code: e.code,
|
||||
message: "registration cancelled",
|
||||
status: 400,
|
||||
statusText: "BAD_REQUEST",
|
||||
@@ -159,6 +162,7 @@ export const getPasskeyActions = (
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
code: e.code,
|
||||
message: e.message,
|
||||
status: 400,
|
||||
statusText: "BAD_REQUEST",
|
||||
@@ -168,6 +172,7 @@ export const getPasskeyActions = (
|
||||
return {
|
||||
data: null,
|
||||
error: {
|
||||
code: "UNKNOWN_ERROR",
|
||||
message: e instanceof Error ? e.message : "unknown error",
|
||||
status: 500,
|
||||
statusText: "INTERNAL_SERVER_ERROR",
|
||||
|
||||
Reference in New Issue
Block a user