Skip to content

Commit bc350d1

Browse files
Merge pull request #536 from remiburtin/patch-silent-refresh
Add noPrompt parameter to setupAutomaticSilentRefresh method
2 parents 5e28f54 + b94bbac commit bc350d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/lib/src/oauth-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ export class OAuthService extends AuthConfig {
160160
* Will setup up silent refreshing for when the token is
161161
* about to expire.
162162
* @param params Additional parameter to pass
163+
* @param noPrompt True if `prompt=none` should be added to the token refresh url
163164
*/
164-
public setupAutomaticSilentRefresh(params: object = {}, listenTo?: 'access_token' | 'id_token' | 'any') {
165+
public setupAutomaticSilentRefresh(params: object = {}, listenTo?: 'access_token' | 'id_token' | 'any', noPrompt = true) {
165166
this.events.pipe(filter(e => e.type === 'token_expires')).subscribe(e => {
166167
const event = e as OAuthInfoEvent;
167168
if ( listenTo == null || listenTo === 'any' || event.info === listenTo ) {
168-
this.silentRefresh(params).catch(_ => {
169+
this.silentRefresh(params, noPrompt).catch(_ => {
169170
this.debug('Automatic silent refresh did not work');
170171
});
171172
}

0 commit comments

Comments
 (0)