mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
refactor: userController and add req user type
This commit is contained in:
1 parent
4c421b4cb3
commit
c912319967
8 files changed
+49
-23
No files matched your search
@@ -1,11 +1,14 @@
|
||||
import { Express } from 'express'
|
||||
import { User, UserProfile } from '@linux-odyssey/models'
|
||||
import { SocialLogin } from '../auth/oauthVerify.js'
|
||||
import { hashPassword } from '../utils/auth.js'
|
||||
|
||||
export async function createUser(
|
||||
username: string,
|
||||
email: string,
|
||||
{ password, socialLogin }: { password?: string; socialLogin?: SocialLogin }
|
||||
{
|
||||
password,
|
||||
socialLogin,
|
||||
}: { password?: string; socialLogin?: Express.SocialLogin }
|
||||
) {
|
||||
const user = new User({
|
||||
username,
|
||||
|
||||
Reference in new issue
Block a user