Last night
This commit is contained in:
parent
2906b01734
commit
42ee2d4c51
47 changed files with 848 additions and 478 deletions
|
|
@ -4,8 +4,6 @@ import pb from '../lib/pocketbase';
|
|||
export interface AuthUser {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
avatar: string;
|
||||
verified: boolean;
|
||||
}
|
||||
|
||||
|
|
@ -15,8 +13,6 @@ function recordToUser(record: any): AuthUser {
|
|||
return {
|
||||
id: record.id || '',
|
||||
email: record.email || '',
|
||||
name: record.name || '',
|
||||
avatar: record.avatar || '',
|
||||
verified: record.verified || false,
|
||||
};
|
||||
}
|
||||
|
|
@ -58,7 +54,7 @@ export function useAuth() {
|
|||
}
|
||||
}, []);
|
||||
|
||||
const register = useCallback(async (email: string, password: string, name?: string) => {
|
||||
const register = useCallback(async (email: string, password: string) => {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
try {
|
||||
|
|
@ -66,7 +62,6 @@ export function useAuth() {
|
|||
email,
|
||||
password,
|
||||
passwordConfirm: password,
|
||||
name: name || '',
|
||||
});
|
||||
// Auto-login after registration
|
||||
const result = await pb.collection('users').authWithPassword(email, password);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue