fix(api-frontend): resolved failure in inviting existing infisical users to organization

This commit is contained in:
akhilmhdh
2022-12-27 23:22:47 +05:30
parent c28d857086
commit c653f807f4
5 changed files with 34 additions and 17 deletions
+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');