Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v92: SessionState and oAuth (session-state.ts) #130

Open
juancarloscamargo opened this issue Mar 13, 2024 · 2 comments
Open

v92: SessionState and oAuth (session-state.ts) #130

juancarloscamargo opened this issue Mar 13, 2024 · 2 comments

Comments

@juancarloscamargo
Copy link

Hi,

Is sessionstate (ISessionState.isOAuth) oAuth status being populated? I'm getting a value of undefined everytime I check it , even with I'm logged in with that auth method. It seems there is no handling of that value within the class:

(...)

export class SessionState implements ISessionState {

public get IsLoggedOut(): boolean { return this.currentAuthStep === AuthStepLevels.LoggedOut; }
public get IsAwaitingSecondaryAuth(): boolean { return this.currentAuthStep === AuthStepLevels.AwaitsSecondaryAuth; }
public get IsLoggedIn(): boolean { return this.currentAuthStep === AuthStepLevels.LoggedIn; }
public get Username(): string { return this.sessionResponse && this.IsLoggedIn ? this.sessionResponse.Status.PrimaryAuth.Display : null; }
public get UserUid(): string { return this.sessionResponse && this.IsLoggedIn ? this.sessionResponse.Status.PrimaryAuth.Uid : null; }
public get SecondaryAuthName(): string {
return this.sessionResponse && this.sessionResponse.Status && this.sessionResponse.Status.SecondaryAuth ?
this.sessionResponse.Status.SecondaryAuth.Name :
null;
}

(...)

@Mathnstein
Copy link
Collaborator

Hi @juancarloscamargo - coming from the developer who worked on this feature:

The sessionstate represents the session regardless of how the user authenticated, including OAuth-based flows. Our components rely on the session state to detect if the user is logged in, and you should be seeing the same state.

@juancarloscamargo
Copy link
Author

Hi @Mathnstein ,

I was trying to figure out how the user authenticated and apply some actions accordingly. That's why I was working with the SessionState class, which implements ISessionState , this one having the following definition:

export interface ISessionState {
IsLoggedOut?: boolean;
IsAwaitingSecondaryAuth?: boolean;
IsLoggedIn?: boolean;
Username?: string;
UserUid?: string;
SecondaryAuthName?: string;
SecondaryErrorMessage?: string;
configurationProviders?: AuthConfigProvider[];
externalLogoutUrl?: string;
isOAuth?: boolean;
hasErrorState?: boolean;
culture?: string;
cultureFormat?: string;
}

, but found that the isOauth value is not being populated.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants