fix: await async generateToken in auth service

- Add await to all generateToken() calls
- Fixes empty token issue in login/register responses
- Token now properly includes user role for admin access
This commit is contained in:
dwindown
2025-10-11 18:08:01 +07:00
parent 1c28e51b53
commit ddca073610
12 changed files with 17 additions and 17 deletions

BIN
apps/api/src/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -44,7 +44,7 @@ export class AuthService {
});
// Generate JWT token
const token = this.generateToken(user.id, user.email);
const token = await this.generateToken(user.id, user.email);
return {
user: {
@@ -123,7 +123,7 @@ export class AuthService {
}
// Generate full JWT token
const token = this.generateToken(user.id, user.email);
const token = await this.generateToken(user.id, user.email);
return {
user: {
@@ -259,7 +259,7 @@ export class AuthService {
}
// Generate JWT token
const token = this.generateToken(user.id, user.email);
const token = await this.generateToken(user.id, user.email);
return {
user: {
@@ -345,7 +345,7 @@ export class AuthService {
}
// Generate full JWT token
const token = this.generateToken(userId, email);
const token = await this.generateToken(userId, email);
return {
user: {