forked from Transparency/kgroad-frontend2
fixed bug with sign-in
This commit is contained in:
1 parent
7bc3e2ccb5
commit
7d36510a9b
6 files changed
+22
-14
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user