+
+ it('Should forward the redirectUrl if the plugin returns one', async function () {
+ const resLogin = await loginExternal({
+ server,
+ npmName: 'test-external-auth-three',
+ authName: 'external-auth-7',
+ username: 'cid'
+ })
+
+ const resLogout = await logout(server.url, resLogin.access_token)
+
+ expect(resLogout.body.redirectUrl).to.equal('https://example.com/redirectUrl')
+ })
+
+ it('Should call the plugin\'s onLogout method with the request', async function () {
+ const resLogin = await loginExternal({
+ server,
+ npmName: 'test-external-auth-three',
+ authName: 'external-auth-8',
+ username: 'cid'
+ })
+
+ const resLogout = await logout(server.url, resLogin.access_token)
+
+ expect(resLogout.body.redirectUrl).to.equal('https://example.com/redirectUrl?access_token=' + resLogin.access_token)
+ })