diff --git a/src/data.ts b/src/data.ts index d841353..5c081bc 100644 --- a/src/data.ts +++ b/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 { - 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; }