Skip to content

Commit

Permalink
fix : set language with ui-culture on auth-code-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
erhanilze committed Oct 1, 2024
1 parent ceb20c7 commit 1f499f9
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { noop } from '@abp/ng.core';
import { Params } from '@angular/router';
import { from, of } from 'rxjs';
import { filter, from, of, tap } from 'rxjs';
import { AuthFlowStrategy } from './auth-flow-strategy';
import { isTokenExpired } from '../utils';

Expand All @@ -12,6 +12,18 @@ export class AuthCodeFlowStrategy extends AuthFlowStrategy {

return super
.init()
.then(() => {
this.oAuthService.events
.pipe(
filter(event => event.type === 'token_received'),
tap(e => {
const urlParams = window.location.search;
const uiCulture = new URLSearchParams(urlParams).get('ui-culture');
this.sessionState.setLanguage(uiCulture);
}),
)
.subscribe();
})
.then(() => this.oAuthService.tryLogin().catch(noop))
.then(() => this.oAuthService.setupAutomaticSilentRefresh());
}
Expand Down

0 comments on commit 1f499f9

Please sign in to comment.