X-Git-Url: http://git.squeep.com/?p=squeep-authentication-module;a=blobdiff_plain;f=test%2Flib%2Fsession-manager.js;h=a3efeafce3b812fcfd3961393e4e015a5986afad;hp=bf8df03b94f8875bfa5306e6f9a59f51546cfbe6;hb=328932bc7484022cb9b2de808cbf18ecd5d7f206;hpb=9a7d5352698481c0857ba8827e31c7cb97625133 diff --git a/test/lib/session-manager.js b/test/lib/session-manager.js index bf8df03..a3efeaf 100644 --- a/test/lib/session-manager.js +++ b/test/lib/session-manager.js @@ -113,6 +113,21 @@ describe('SessionManager', function () { await manager.postAdminLogin(res, ctx); assert(!res.setHeader.called); }); + it('covers profile scheme fallback', async function () { + ctx.parsedBody.me = 'https://example.com/profile'; + ctx.parsedBody.me_auto_scheme = '1'; + manager.indieAuthCommunication.fetchProfile + .onCall(0).resolves() + .onCall(1).resolves({ + metadata: { + issuer: 'https://example.com/', + authorizationEndpoint: 'https://example.com/auth', + }, + }); + await manager.postAdminLogin(res, ctx); + assert.strictEqual(res.statusCode, 302); + + }); describe('living-standard-20220212', function () { it('covers valid profile', async function () { ctx.parsedBody.me = 'https://example.com/profile';