mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-21 12:10:17 -04:00
add registration code
This commit is contained in:
parent
43edcb5826
commit
50013f6340
13
src/data.ts
13
src/data.ts
|
@ -1,3 +1,4 @@
|
|||
import { v4 } from 'uuid';
|
||||
import { IonProfile } from './auth_ion';
|
||||
|
||||
/**
|
||||
|
@ -76,5 +77,15 @@ export async function getUserByEmail(
|
|||
export async function registerUserFromIonProfile(
|
||||
profile: IonProfile
|
||||
): Promise<string> {
|
||||
return 'new_user_0';
|
||||
const id = v4();
|
||||
const user: Carpool.User = {
|
||||
id,
|
||||
username: profile.ion_username,
|
||||
email: profile.tj_email,
|
||||
first_name: profile.first_name,
|
||||
last_name: profile.last_name,
|
||||
};
|
||||
users[id] = user;
|
||||
console.log('Registered user', user);
|
||||
return id;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user