Fix Admin panel categories modal, add error handling, enforce cursor-pointer globally
This commit is contained in:
1 parent
69502fc380
commit
82ab454647
47 files changed
+2968
-653
No files matched your search
@@ -66,11 +66,11 @@ export class AuthService {
|
||||
|
||||
async adminLogin(body: any) {
|
||||
if (body.email === 'admin@canina-iran.com' && body.password === 'admin123') {
|
||||
const payload = { sub: 'admin-123', email: body.email, role: 'Admin' };
|
||||
const payload = { sub: '12345678-1234-1234-1234-123456789012', email: body.email, role: 'Admin' };
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
user: { id: 'admin-123', email: body.email, role: 'Admin' },
|
||||
user: { id: '12345678-1234-1234-1234-123456789012', email: body.email, role: 'Admin' },
|
||||
accessToken: this.jwtService.sign(payload),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -14,8 +14,9 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
}
|
||||
|
||||
async validate(payload: any) {
|
||||
if (payload.sub === 'admin-123') {
|
||||
return { id: 'admin-123', email: 'admin@canina-iran.com', role: 'ADMIN' };
|
||||
// Bypass DB lookup for local admin user to prevent UUID casting errors
|
||||
if (payload.sub === '12345678-1234-1234-1234-123456789012') {
|
||||
return { id: payload.sub, email: payload.email, role: payload.role };
|
||||
}
|
||||
|
||||
const user = await this.usersService.findById(payload.sub);
|
||||
|
||||
Reference in new issue
Block a user