mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 20:51:33 +10:00
wip: test
This commit is contained in:
40
apps/remix/app/routes/signin.tsx
Normal file
40
apps/remix/app/routes/signin.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { authClient } from '~/lib/auth-client';
|
||||
|
||||
export default function SignIn() {
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
|
||||
const signIn = async () => {
|
||||
await authClient.signIn.email(
|
||||
{
|
||||
email,
|
||||
password,
|
||||
},
|
||||
{
|
||||
onRequest: (ctx) => {
|
||||
// show loading state
|
||||
},
|
||||
onSuccess: (ctx) => {
|
||||
// redirect to home
|
||||
},
|
||||
onError: (ctx) => {
|
||||
alert(ctx.error);
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Sign In</h2>
|
||||
<input type="email" value={email} onChange={(e) => setEmail(e.target.value)} />
|
||||
<input type="password" value={password} onChange={(e) => setPassword(e.target.value)} />
|
||||
|
||||
<button type="submit" onClick={signIn}>
|
||||
Sign In
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user