feat: redirect to verify pages
This commit is contained in:
@ -63,6 +63,18 @@ const AuthLayout = () => {
|
|||||||
connecting,
|
connecting,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const verificationRequired = useMemo(() => {
|
||||||
|
return (
|
||||||
|
authProfile?.email_verified === false ||
|
||||||
|
authProfile?.avatar_verified === false ||
|
||||||
|
authProfile?.verified === false
|
||||||
|
);
|
||||||
|
}, [
|
||||||
|
authProfile?.avatar_verified,
|
||||||
|
authProfile?.email_verified,
|
||||||
|
authProfile?.verified,
|
||||||
|
]);
|
||||||
|
|
||||||
// OAuth
|
// OAuth
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(
|
console.log(
|
||||||
@ -140,7 +152,7 @@ const AuthLayout = () => {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
!signInRequired &&
|
!signInRequired &&
|
||||||
authProfile?.email_verified === false &&
|
verificationRequired &&
|
||||||
!location.pathname.startsWith("/verify")
|
!location.pathname.startsWith("/verify")
|
||||||
) {
|
) {
|
||||||
return <Navigate to="/verify" />;
|
return <Navigate to="/verify" />;
|
||||||
|
Reference in New Issue
Block a user