-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.ts
More file actions
26 lines (23 loc) · 803 Bytes
/
index.ts
File metadata and controls
26 lines (23 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { loginEmail } from './login-email'
import { me } from './me'
import { resetPasswordEmail, validateResetToken } from './reset-password'
import { sendEmailResetPassword } from './send-email-reset-password'
import { signOut } from './sign-out'
import { signUp } from './sign-up'
import type { AuthConfig } from '..'
export function createAuthHandlers<TAuthConfig extends AuthConfig>(config: TAuthConfig) {
const handlers = {
// No authentication required
signUp: signUp(config),
loginEmail: loginEmail(config),
signOut: signOut({}),
resetPasswordEmail: resetPasswordEmail({}),
sendEmailResetPassword: sendEmailResetPassword({}),
validateResetToken: validateResetToken({}),
// Authentication required
me: me({}),
} as const
return {
handlers,
}
}