now sending userid on login and register
This commit is contained in:
		@@ -15,10 +15,10 @@ class UserController {
 | 
			
		||||
    async register(req, res) {
 | 
			
		||||
        const { username, password } = req.body;
 | 
			
		||||
 | 
			
		||||
        await UserService.create(username, password);
 | 
			
		||||
        let userId = await UserService.create(username, password);
 | 
			
		||||
 | 
			
		||||
        log.info(`New user with name ${username} has just registered`);
 | 
			
		||||
        return res.status(200).send(translate(req.headers["accept-language"], responseCodes.responses.general.ok));
 | 
			
		||||
        return res.status(200).send(userId.toString());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async login(req, res) {
 | 
			
		||||
@@ -28,7 +28,7 @@ class UserController {
 | 
			
		||||
        if (!bcrypt.compareSync(password, user.password)) throw new customError(`Wrong user password`, responseCodes.responses.passwords.invalid);
 | 
			
		||||
 | 
			
		||||
        const token = jwtutils.genToken(user);
 | 
			
		||||
        return res.status(200).send(token);
 | 
			
		||||
        return res.status(200).send({ id: user.id, token: token });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async synchronize(req, res) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user