Skip to content

Commit

Permalink
fix: account urls are not per project (#19933)
Browse files Browse the repository at this point in the history
* fix: account urls are not per project

* add a test or two
  • Loading branch information
pauldambra authored Jan 23, 2024
1 parent 3c8627a commit 8cbd8d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/lib/utils/router-utils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { addProjectIdIfMissing } from 'lib/utils/router-utils'

describe('router-utils', () => {
it('does not redirect account URLs to a project URL', () => {
const altered = addProjectIdIfMissing('/account/two_factor', 123)
expect(altered).toEqual('/account/two_factor')
})
it('does not allow account urls to have a project url', () => {
const altered = addProjectIdIfMissing('/project/123/account/two_factor', 123)
expect(altered).toEqual('/account/two_factor')
})
})
1 change: 1 addition & 0 deletions frontend/src/lib/utils/router-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const pathsWithoutProjectId = [
'login',
'signup',
'create-organization',
'account',
]

function isPathWithoutProjectId(path: string): boolean {
Expand Down

0 comments on commit 8cbd8d4

Please sign in to comment.