refactor utils

This commit is contained in:
wancat committed 2024-02-19 18:05:00 +08:00
1 parent 9509bbc355
commit d6c95cea4a
13 files changed
+126 -31

No files matched your search

@@ -1,7 +1,12 @@
import { User, UserProfile } from '@linux-odyssey/models'
import { SocialLogin } from '../auth/oauthVerify.js'
import { hashPassword } from '../utils/auth.js'
export async function createUser(username, email, { password, socialLogin }) {
export async function createUser(
username: string,
email: string,
{ password, socialLogin }: { password?: string; socialLogin?: SocialLogin }
) {
const user = new User({
username,
email,