advance
This commit is contained in:
0
app/(auth)/auth/callback/route.ts
Normal file → Executable file
0
app/(auth)/auth/callback/route.ts
Normal file → Executable file
8
app/(auth)/auth/login/page.tsx
Normal file → Executable file
8
app/(auth)/auth/login/page.tsx
Normal file → Executable file
@@ -3,6 +3,8 @@ import LoginForm from "@/components/auth/LoginForm";
|
||||
type LoginPageProps = {
|
||||
searchParams: Promise<{
|
||||
redirectTo?: string | string[];
|
||||
role?: string | string[];
|
||||
forgot?: string | string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -10,6 +12,10 @@ export default async function LoginPage({ searchParams }: LoginPageProps) {
|
||||
const params = await searchParams;
|
||||
const redirectValue = params.redirectTo;
|
||||
const redirectTo = Array.isArray(redirectValue) ? redirectValue[0] : redirectValue;
|
||||
const roleValue = params.role;
|
||||
const role = Array.isArray(roleValue) ? roleValue[0] : roleValue;
|
||||
const forgotValue = params.forgot;
|
||||
const forgot = Array.isArray(forgotValue) ? forgotValue[0] : forgotValue;
|
||||
|
||||
return <LoginForm redirectTo={redirectTo ?? "/courses"} />;
|
||||
return <LoginForm redirectTo={redirectTo ?? "/courses"} role={role} showForgot={forgot === "1"} />;
|
||||
}
|
||||
|
||||
9
app/(auth)/auth/signup/page.tsx
Normal file → Executable file
9
app/(auth)/auth/signup/page.tsx
Normal file → Executable file
@@ -81,6 +81,15 @@ export default function SignupPage() {
|
||||
Login
|
||||
</Link>
|
||||
</p>
|
||||
<p className="mt-2 text-sm text-slate-600">
|
||||
Are you a teacher?{" "}
|
||||
<Link className="font-semibold text-brand" href="/auth/login?role=teacher">
|
||||
Login here
|
||||
</Link>
|
||||
</p>
|
||||
<p className="mt-2 text-xs text-slate-500">
|
||||
Teacher accounts are invite-only. If you received an invite, use the email provided.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user