feat: magic-link auth complete

This commit is contained in:
Balu Babu
2023-01-10 16:06:42 +05:30
parent 0c154be04e
commit fc284fd0a2
17 changed files with 6590 additions and 65 deletions

View File

@@ -20,8 +20,21 @@ export class UserService {
}
}
async createUser(email: string) {
const createdUser = await this.prisma.user.create({
async findUserById(userUid: string) {
try {
const user: User = await this.prisma.user.findUniqueOrThrow({
where: {
id: userUid,
},
});
return O.some(user);
} catch (error) {
return O.none;
}
}
async createUserMagic(email: string) {
const createdUser: User = await this.prisma.user.create({
data: {
email: email,
accounts: {