Skip to content

Commit

Permalink
Prompt should be passed as an auth param (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath committed Apr 9, 2021
1 parent 52f646f commit d1ed72f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ class ResponseContext {
return urlJoin(config.baseURL, config.routes.callback);
}

silentLogin(options) {
silentLogin(options = {}) {
return this.login({
...options,
prompt: 'none',
authorizationParams: { ...options.authorizationParams, prompt: 'none' },
});
}

Expand Down
3 changes: 3 additions & 0 deletions test/attemptSilentLogin.tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { URL } = require('url');
const { assert } = require('chai');
const { create: createServer } = require('./fixture/server');
const { makeIdToken } = require('./fixture/cert');
Expand Down Expand Up @@ -50,6 +51,8 @@ describe('attemptSilentLogin', () => {
const response = await request({ baseUrl, jar, url: '/protected' });

assert.equal(response.statusCode, 302);
const uri = new URL(response.headers.location);
assert.equal(uri.searchParams.get('prompt'), 'none');
assert.include(jar.getCookies(baseUrl)[0], {
key: 'skipSilentLogin',
value: 'true',
Expand Down

0 comments on commit d1ed72f

Please sign in to comment.