mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: fix createUser without password
This commit is contained in:
1 parent
d3945eeaa7
commit
f81c96be62
3 files changed
+5
-4
No files matched your search
@@ -8,9 +8,10 @@ export async function createUser(username, email, { password, socialLogin }) {
|
||||
})
|
||||
if (password) {
|
||||
user.hashedPassword = await hashPassword(password)
|
||||
}
|
||||
if (socialLogin) {
|
||||
} else if (socialLogin) {
|
||||
user.socialLogins.set(socialLogin.provider, socialLogin)
|
||||
} else {
|
||||
throw new Error('No password or social login provided')
|
||||
}
|
||||
await user.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user