From 5edf09e0a7819bd122e1234e5a3363cd40817b88 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Tue, 31 Aug 2021 12:50:04 +0500 Subject: [PATCH] fix: usernames to lower case --- src/auth/AuthManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auth/AuthManager.ts b/src/auth/AuthManager.ts index ebed529..8156a71 100644 --- a/src/auth/AuthManager.ts +++ b/src/auth/AuthManager.ts @@ -23,7 +23,7 @@ export class AuthManager { * Logs into the SAS server with the supplied credentials. * @param username - a string representing the username. * @param password - a string representing the password. - * @returns - a boolean `isLoggedin` + * @returns - a boolean `isLoggedin` and a string `username` */ public async logIn( username: string, @@ -161,12 +161,12 @@ export class AuthManager { return Promise.resolve({ isLoggedIn, - userName, + userName: userName?.toLowerCase(), loginForm }) } - private extractUserName = (response: any) => + private extractUserName = (response: any): string => this.serverType === 'SASVIYA' ? response?.id : response?.match(/"title":"Log Off [0-1a-zA-Z]*"/)?.[0].slice(17, -1)