mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-12-31 21:56:41 +01:00
「✨」 feat: now creating user on the user api when registering
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import authDB from '../../utils/authDB.js';
|
||||
import { authUserCreate } from '../../utils/authUserCreate.js';
|
||||
|
||||
var env = process.env.NODE_ENV || 'development';
|
||||
|
||||
@ -46,6 +47,8 @@ export async function gRegisterCallback(request, reply, fastify) {
|
||||
|
||||
authDB.addUser(user.username, '');
|
||||
|
||||
authUserCreate(user.username, fastify)
|
||||
|
||||
const token = fastify.jwt.sign(user);
|
||||
|
||||
return reply
|
||||
|
||||
@ -2,6 +2,7 @@ import bcrypt from 'bcrypt';
|
||||
|
||||
import { isValidString } from '../../utils/authUtils.js';
|
||||
import authDB from '../../utils/authDB.js';
|
||||
import { authUserCreate } from '../../utils/authUserCreate.js';
|
||||
|
||||
var env = process.env.NODE_ENV || 'development';
|
||||
|
||||
@ -36,6 +37,8 @@ export async function register(request, reply, saltRounds, fastify) {
|
||||
const hash = await bcrypt.hash(password, saltRounds);
|
||||
authDB.addUser(user, hash);
|
||||
|
||||
authUserCreate(user, fastify)
|
||||
|
||||
const token = fastify.jwt.sign({ user });
|
||||
|
||||
return reply
|
||||
|
||||
Reference in New Issue
Block a user