Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions projects/lib/src/oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ export class OAuthService extends AuthConfig {
* Will setup up silent refreshing for when the token is
* about to expire.
* @param params Additional parameter to pass
* @param noPrompt True if `prompt=none` should be added to the token refresh url
*/
public setupAutomaticSilentRefresh(params: object = {}, listenTo?: 'access_token' | 'id_token' | 'any') {
public setupAutomaticSilentRefresh(params: object = {}, listenTo?: 'access_token' | 'id_token' | 'any', noPrompt = true) {
this.events.pipe(filter(e => e.type === 'token_expires')).subscribe(e => {
const event = e as OAuthInfoEvent;
if ( listenTo == null || listenTo === 'any' || event.info === listenTo ) {
this.silentRefresh(params).catch(_ => {
this.silentRefresh(params, noPrompt).catch(_ => {
this.debug('Automatic silent refresh did not work');
});
}
Expand Down