From 7fed637506043e4432cbebe041ada0625171cceb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Apr 2020 16:07:04 +0200 Subject: Begin auth plugin support --- shared/extra-utils/users/login.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'shared/extra-utils/users') diff --git a/shared/extra-utils/users/login.ts b/shared/extra-utils/users/login.ts index 4fe54a74a..2d68337a6 100644 --- a/shared/extra-utils/users/login.ts +++ b/shared/extra-utils/users/login.ts @@ -27,6 +27,16 @@ function login (url: string, client: Client, user: User, expectedStatus = 200) { .expect(expectedStatus) } +function logout (url: string, token: string, expectedStatus = 200) { + const path = '/api/v1/users/revoke-token' + + return request(url) + .post(path) + .set('Authorization', 'Bearer ' + token) + .type('form') + .expect(expectedStatus) +} + async function serverLogin (server: Server) { const res = await login(server.url, server.client, server.user, 200) @@ -71,6 +81,7 @@ function setAccessTokensToServers (servers: ServerInfo[]) { export { login, + logout, serverLogin, userLogin, getAccessToken, -- cgit v1.2.3