Skip to content

Commit 39b64e7

Browse files
Martin Guethlebabangsund
authored andcommitted
Allow to specify the path prefix within the logout, too
1 parent 9044bad commit 39b64e7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Two `cy` commands have been added:
3333
- `root`: string
3434
- `realm`: string
3535
- `redirect_uri`: string
36+
- `path_prefix`?: string = "auth"
3637
- **`cy.login({ ... })`**:
3738
- `root`: string
3839
- `realm`: string

src/logout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Cypress.Commands.add('logout', ({ root, realm, redirect_uri }) =>
1+
Cypress.Commands.add('logout', ({ root, realm, redirect_uri, path_prefix = 'auth' }) =>
22
cy.request({
33
qs: { redirect_uri },
4-
url: `${root}/auth/realms/${realm}/protocol/openid-connect/logout`,
4+
url: `${root}${ path_prefix ? `/${path_prefix}` : ''}/realms/${realm}/protocol/openid-connect/logout`,
55
})
66
);

0 commit comments

Comments
 (0)