fixed bug with sign-in

This commit is contained in:
Alibek committed 2024-03-13 16:48:13 +06:00
1 parent 7bc3e2ccb5
commit 7d36510a9b
6 files changed
+22 -14

No files matched your search

+5 -9
View File
@@ -70,12 +70,12 @@ export const authConfig: AuthOptions = {
const res = await apiInstance.post("/users/login/", data);
if (![200, 201].includes(res.status)) {
return null;
if ([200, 201].includes(res.status)) {
const user = res.data;
return user;
}
const user = res.data;
return user;
return null;
},
}),
GoogleProvider({
@@ -90,11 +90,7 @@ export const authConfig: AuthOptions = {
strategy: "jwt",
},
callbacks: {
async signIn({ account, profile, user }) {
if (!profile?.email) {
throw new Error("No Profile");
}
async signIn({ account, user }) {
if (account?.provider === "google") {
const data = {
auth_token: account?.id_token,