refactor: update auth error messages to use Professional terminology instead of Agent
This commit is contained in:
@@ -68,9 +68,9 @@ export class AuthService {
|
||||
});
|
||||
|
||||
if (existingUser) {
|
||||
const existingRoleLabel = existingUser.role === UserRole.AGENT ? 'agent' : 'user';
|
||||
const existingRoleLabel = existingUser.role === UserRole.AGENT ? 'Professional' : 'User';
|
||||
throw new ConflictException(
|
||||
`Email address is already registered as an ${existingRoleLabel}. Kindly use a different email address for the new signup.`,
|
||||
`Email address is already registered as a ${existingRoleLabel}. Kindly use a different email address for the new signup.`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export class AuthService {
|
||||
if (dto.loginRole) {
|
||||
if (dto.loginRole === 'USER' && user.role === UserRole.AGENT) {
|
||||
throw new UnauthorizedException(
|
||||
'This email is registered as an Agent. Please use the Agent tab to sign in.',
|
||||
'This email is registered as a Professional. Please use the Professional tab to sign in.',
|
||||
);
|
||||
}
|
||||
if (dto.loginRole === 'AGENT' && user.role === UserRole.USER) {
|
||||
|
||||
Reference in New Issue
Block a user