Updated login and registration with email confirmation
This commit is contained in:
1 parent
061bed2b59
commit
167baf9e82
5 files changed
+104
-22
No files matched your search
@@ -6,7 +6,10 @@ import { loginAction, type LoginState } from "./actions";
|
||||
|
||||
const initialState: LoginState = null;
|
||||
|
||||
export default function LoginForm({ next }: { next?: string }) {
|
||||
export default function LoginForm({
|
||||
next,
|
||||
initialError,
|
||||
}: Readonly<{ next?: string; initialError?: string }>) {
|
||||
const [state, action, pending] = useActionState(loginAction, initialState);
|
||||
|
||||
return (
|
||||
@@ -47,6 +50,10 @@ export default function LoginForm({ next }: { next?: string }) {
|
||||
</div>
|
||||
{state?.error ? (
|
||||
<p className="text-sm text-red-600">{state.error}</p>
|
||||
) : initialError === "confirmation-failed" ? (
|
||||
<p className="text-sm text-red-600">
|
||||
Email confirmation failed. Please try registering again.
|
||||
</p>
|
||||
) : null}
|
||||
<button
|
||||
type="submit"
|
||||
|
||||
Reference in new issue
Block a user