@@ -18,12 +18,14 @@ import {LogoutRedirectComponent} from "../logout-redirect/logout-redirect.compon
18
18
@Injectable ( )
19
19
export class AuthService {
20
20
private tokenRecentlyAcquired : Set < string > ;
21
+ private recentlyLoggedOut : Set < string > ;
21
22
22
23
private siteSpecificSettings : ImmutableMap < string , SiteSetting > = ImmutableMap ( ) ;
23
24
private currentEntryPoint : CurrentEntryPoint = { } ;
24
25
25
26
constructor ( private settingsService : SettingsService , private store : Store < { appSettings : AppSettings , currentEntryPoint : CurrentEntryPoint } > ) {
26
27
this . tokenRecentlyAcquired = new Set ( ) ;
28
+ this . recentlyLoggedOut = new Set ( ) ;
27
29
28
30
this . store
29
31
. select ( s => s . appSettings . siteSettings . siteSpecificSettings )
@@ -65,7 +67,8 @@ export class AuthService {
65
67
this . settingsService . SaveCurrentSettings ( ) ;
66
68
67
69
try {
68
- await userManager . signinRedirect ( ) ;
70
+ const prompt = this . recentlyLoggedOut . has ( siteUrl ) ? 'select_account' : undefined ;
71
+ await userManager . signinRedirect ( { prompt : prompt } ) ;
69
72
return Success ( Unit . NoThing ) ;
70
73
} catch {
71
74
return Failure ( "Error during authentication" ) ;
@@ -141,6 +144,7 @@ export class AuthService {
141
144
} ) ) ;
142
145
}
143
146
this . tokenRecentlyAcquired . add ( entryPoint ) ;
147
+ this . recentlyLoggedOut . delete ( siteUrl ) ;
144
148
this . store . dispatch ( setAuthenticationInProgress ( { siteUrl : siteUrl , authenticationInProgress : false } ) )
145
149
this . settingsService . SaveCurrentSettings ( ) ;
146
150
return Success ( Unit . NoThing ) ;
@@ -206,6 +210,7 @@ export class AuthService {
206
210
207
211
try {
208
212
await userManager . signoutCallback ( ) ;
213
+ this . recentlyLoggedOut . add ( siteUrl )
209
214
this . store . dispatch ( setAuthConfig ( { siteUrl : siteUrl , authConfig : undefined } ) )
210
215
return Success ( Unit . NoThing ) ;
211
216
} catch ( err ) {
0 commit comments