Merge pull request #180 from akhilmhdh/fix/failed-workspace-membership-invite

fix(backend): resolved workspace membership invite failure
This commit is contained in:
mv-turtle
2022-12-27 16:13:09 -05:00
committed by GitHub
6 changed files with 35 additions and 18 deletions
+1 -7
View File
@@ -10,13 +10,7 @@ const checkAuth = async () => {
headers: {
'Content-Type': 'application/json'
}
}).then((res) => {
if (res && res.status == 200) {
return res;
} else {
console.log('Not authorized');
}
});
}).then((res) => res);
};
export default checkAuth;
+11 -2
View File
@@ -159,8 +159,17 @@ export default function SignupInvite() {
code: token
});
if (response.status == 200) {
setVerificationToken((await response.json()).token);
setStep(2);
const res = await response.json();
// user will have temp token if doesn't have an account
// then continue with account setup workflow
if(res?.token){
setVerificationToken(res.token);
setStep(2);
} else {
// user will be redirected to dashboard
// if not logged in gets kicked out to login
router.push("/dashboard")
}
} else {
console.log('ERROR', response);
router.push('/requestnewinvite');