-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue where query-params get replicated (for example oidc-topic) …
…after logout or in the buildUrl helper, allowed params have to be whitelisted now.
- Loading branch information
Showing
5 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
changelog/unreleased/bugfix-oidc-logout-query-param-replication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bugfix: Broken re-login after logout | ||
|
||
After a user logged out, it was no longer possible to login without reloading the ocis root domain, | ||
this has now been fixed and only allowed query-params are taken into account. | ||
|
||
https://github.com/owncloud/web/pull/8694 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/web-runtime/tests/unit/services/auth/authService.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { AuthService } from 'web-runtime/src/services/auth/authService' | ||
|
||
describe('AuthService', () => { | ||
describe('signInCallback', () => { | ||
it.each([ | ||
[{ details: 'details' }, { details: 'details' }], | ||
[{ details: 'details', unknown: 'unknown' }, { details: 'details' }], | ||
[{ unknown: 'unknown' }, {}] | ||
])('forwards only whitelisted query parameters: %s = %s', async (query, expected: any) => { | ||
const authService = new AuthService() | ||
const replace = jest.fn() | ||
|
||
jest.replaceProperty(authService as any, 'userManager', { | ||
signinRedirectCallback: jest.fn(), | ||
getAndClearPostLoginRedirectUrl: jest.fn() | ||
}) | ||
|
||
jest.replaceProperty(authService as any, 'router', { | ||
currentRoute: { query }, | ||
replace | ||
}) | ||
await authService.signInCallback() | ||
|
||
expect(replace.mock.calls[0][0].query).toEqual(expected) | ||
}) | ||
}) | ||
}) |