Skip to content

Commit 766019e

Browse files
committed
fix(user service): remove token details when the user is not ACTIVE during login
1 parent 0d727af commit 766019e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/user/user.service.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,17 @@ export class UserService {
274274
uuidv4(),
275275
);
276276
if (userDBResponse.account_status !== 'ACTIVE') {
277-
response.responseCode = ResponseCode.FAILURE;
278-
response.params.err = 'INVALID_ACCOUNT_STATUS';
279-
response.params.errMsg =
280-
'Your account is currently no in ACTIVE state.';
281-
response.params.status = ResponseStatus.failure;
277+
delete fusionAuthUser.refreshToken;
278+
delete fusionAuthUser.token;
279+
response.responseCode = ResponseCode.OK;
280+
response.result = {
281+
responseMsg: 'Successful Logged In',
282+
accountStatus: AccountStatus[userDBResponse?.account_status],
283+
data: {
284+
user: fusionAuthUser,
285+
schoolResponse: userDBResponse,
286+
},
287+
};
282288
} else {
283289
response.responseCode = ResponseCode.OK;
284290
response.result = {

0 commit comments

Comments
 (0)