mirror of https://gitee.com/answerdev/answer.git
fix: oauth asjustment
This commit is contained in:
parent
3285d54ee9
commit
0529c10c54
|
@ -162,7 +162,7 @@ const Index: React.FC = () => {
|
|||
useEffect(() => {
|
||||
const isInactive = searchParams.get('status');
|
||||
|
||||
if ((storeUser.id && storeUser.mail_status === 2) || isInactive) {
|
||||
if (storeUser.id && (storeUser.mail_status === 2 || isInactive)) {
|
||||
setStep(2);
|
||||
}
|
||||
}, []);
|
||||
|
|
|
@ -7,6 +7,7 @@ import { loggedUserInfoStore } from '@/stores';
|
|||
import { getLoggedUserInfo } from '@/services';
|
||||
import Storage from '@/utils/storage';
|
||||
import { LOGGED_TOKEN_STORAGE_KEY } from '@/common/constants';
|
||||
import { guard } from '@/utils';
|
||||
|
||||
const Index: FC = () => {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'page_title' });
|
||||
|
@ -22,9 +23,15 @@ const Index: FC = () => {
|
|||
Storage.set(LOGGED_TOKEN_STORAGE_KEY, token);
|
||||
getLoggedUserInfo().then((res) => {
|
||||
updateUser(res);
|
||||
setTimeout(() => {
|
||||
loginRedirect();
|
||||
}, 0);
|
||||
const userStat = guard.deriveLoginState();
|
||||
if (userStat.isNotActivated) {
|
||||
// inactive
|
||||
navigate('/users/login?status=inactive', { replace: true });
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
loginRedirect();
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
navigate('/', { replace: true });
|
||||
|
|
Loading…
Reference in New Issue