mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-17 17:10:05 +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:
@@ -43,13 +43,15 @@ export class AuthManager {
|
|||||||
} = await this.fetchUserName()
|
} = await this.fetchUserName()
|
||||||
|
|
||||||
if (isLoggedInAlready) {
|
if (isLoggedInAlready) {
|
||||||
|
const logger = process.logger || console
|
||||||
|
logger.log('login was not attempted as a valid session already exists')
|
||||||
|
|
||||||
await this.loginCallback()
|
await this.loginCallback()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoggedIn: true,
|
isLoggedIn: true,
|
||||||
userName: currentSessionUserName,
|
userName: currentSessionUserName,
|
||||||
userLongName: currentSessionUserLongName,
|
userLongName: currentSessionUserLongName
|
||||||
message: 'User is already Logged In!'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +113,9 @@ export class AuthManager {
|
|||||||
} = await this.checkSession()
|
} = await this.checkSession()
|
||||||
|
|
||||||
if (isLoggedInAlready) {
|
if (isLoggedInAlready) {
|
||||||
|
const logger = process.logger || console
|
||||||
|
logger.log('login was not attempted as a valid session already exists')
|
||||||
|
|
||||||
await this.loginCallback()
|
await this.loginCallback()
|
||||||
|
|
||||||
this.userName = loginParams.username
|
this.userName = loginParams.username
|
||||||
@@ -118,8 +123,7 @@ export class AuthManager {
|
|||||||
return {
|
return {
|
||||||
isLoggedIn: true,
|
isLoggedIn: true,
|
||||||
userName: this.userName,
|
userName: this.userName,
|
||||||
userLongName: this.userLongName,
|
userLongName: this.userLongName
|
||||||
message: 'User is already Logged In!'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ export interface LoginResult {
|
|||||||
isLoggedIn: boolean
|
isLoggedIn: boolean
|
||||||
userName: string
|
userName: string
|
||||||
userLongName: string
|
userLongName: string
|
||||||
message?: string
|
|
||||||
}
|
}
|
||||||
export interface LoginResultInternal {
|
export interface LoginResultInternal {
|
||||||
isLoggedIn: boolean
|
isLoggedIn: boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user