creating tokens and such

This commit is contained in:
talksik
2022-04-01 12:38:52 -04:00
parent ce0fb7a885
commit 0e69e0ed64
5 changed files with 48 additions and 34 deletions
+2 -4
View File
@@ -59,11 +59,9 @@ export class UserService {
}
static async createUserIfNotExists(newUser: User) {
const exists = (
await collections.users?.findOne({ googleId: newUser.googleId })
)?._id;
const getUser = await this.getUserByEmail(newUser.email);
if (!exists) {
if (!getUser) {
return await collections.users?.insertOne(newUser);
}