Enforced approval rights
This commit is contained in:
@@ -90,14 +90,15 @@ export const AccountActivationModal: React.FC<AccountActivationModalProps> = ({
|
||||
);
|
||||
}
|
||||
// If result.success is true, AuthProvider updates state, and this modal unmounts automatically!
|
||||
} catch (err: any) {
|
||||
if (err?.response?.status === 401) {
|
||||
} catch (err: unknown) {
|
||||
const errObj = err as { response?: { status?: number }; message?: string };
|
||||
if (errObj?.response?.status === 401) {
|
||||
await onLogout();
|
||||
navigate('/', { replace: true });
|
||||
return;
|
||||
}
|
||||
setErrorMessage(
|
||||
err?.message ||
|
||||
errObj?.message ||
|
||||
'Account activation check encountered an error. Please confirm with your administrator and try again.'
|
||||
);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user