We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40e06fa commit fce8d24Copy full SHA for fce8d24
1 file changed
SparkyFitnessFrontend/src/api/Auth/auth.ts
@@ -64,6 +64,12 @@ export const registerUser = async (
64
65
const authData = data as BetterAuthResponse | null;
66
67
+ if (!authData?.user) {
68
+ throw new Error(
69
+ 'Registration succeeded but no user data was received from the server.'
70
+ );
71
+ }
72
+
73
return {
74
message: 'User registered successfully',
75
userId: authData?.user?.id,
@@ -89,6 +95,13 @@ export const loginUser = async (
89
95
}
90
96
91
97
98
99
100
101
102
103
104
92
105
// Better Auth native 2FA handling
93
106
if (authData?.twoFactorRedirect) {
94
107
0 commit comments