1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-10 17:04:36 +00:00

fix: write a message to the log indicating that a login was not attempted as a valid session already exists

This commit is contained in:
2023-03-24 15:11:10 +05:00
parent 17a3d1b8a9
commit 99d783e174
2 changed files with 8 additions and 5 deletions

View File

@@ -43,13 +43,15 @@ export class AuthManager {
} = await this.fetchUserName()
if (isLoggedInAlready) {
const logger = process.logger || console
logger.log('login was not attempted as a valid session already exists')
await this.loginCallback()
return {
isLoggedIn: true,
userName: currentSessionUserName,
userLongName: currentSessionUserLongName,
message: 'User is already Logged In!'
userLongName: currentSessionUserLongName
}
}
@@ -111,6 +113,9 @@ export class AuthManager {
} = await this.checkSession()
if (isLoggedInAlready) {
const logger = process.logger || console
logger.log('login was not attempted as a valid session already exists')
await this.loginCallback()
this.userName = loginParams.username
@@ -118,8 +123,7 @@ export class AuthManager {
return {
isLoggedIn: true,
userName: this.userName,
userLongName: this.userLongName,
message: 'User is already Logged In!'
userLongName: this.userLongName
}
}

View File

@@ -6,7 +6,6 @@ export interface LoginResult {
isLoggedIn: boolean
userName: string
userLongName: string
message?: string
}
export interface LoginResultInternal {
isLoggedIn: boolean