feat: Add email verification and password reset
This commit is contained in:
@@ -19,7 +19,7 @@ dayjs.extend(relativeTime);
|
||||
dayjs.extend(advancedFormat);
|
||||
|
||||
// Routes that don't require authentication
|
||||
const PUBLIC_ROUTES = ['/auth/login', '/auth/signup', '/auth/reset', '/unsubscribe', '/subscribe', '/manage'];
|
||||
const PUBLIC_ROUTES = ['/auth/login', '/auth/signup', '/auth/reset-password', '/auth/verify-email', '/unsubscribe', '/subscribe', '/manage'];
|
||||
|
||||
// Routes that don't require a project
|
||||
const NO_PROJECT_ROUTES = ['/projects/create'];
|
||||
@@ -35,8 +35,8 @@ function App({Component, pageProps}: AppProps) {
|
||||
function AuthGuard({children}: {children: React.ReactNode}) {
|
||||
const {data: user, isLoading} = useUser();
|
||||
const router = useRouter();
|
||||
const isPublicRoute = PUBLIC_ROUTES.some(route =>
|
||||
router.pathname === route || router.pathname.startsWith(`${route}/`)
|
||||
const isPublicRoute = PUBLIC_ROUTES.some(
|
||||
route => router.pathname === route || router.pathname.startsWith(`${route}/`),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -111,8 +111,8 @@ export default function WithProviders(props: AppProps) {
|
||||
|
||||
function Root(props: AppProps) {
|
||||
const router = useRouter();
|
||||
const isPublicRoute = PUBLIC_ROUTES.some(route =>
|
||||
router.pathname === route || router.pathname.startsWith(`${route}/`)
|
||||
const isPublicRoute = PUBLIC_ROUTES.some(
|
||||
route => router.pathname === route || router.pathname.startsWith(`${route}/`),
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user