Skip to content

Commit

Permalink
Adds a check to ensure that the URL view belongs to the board or redi…
Browse files Browse the repository at this point in the history
…rects (#1468)

* Adds a check to ensure that the URL view belongs to the board or redirects

* Fix linter
  • Loading branch information
mgdelacroix authored Oct 6, 2021
1 parent ee3f008 commit 85ccc05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/pages/boardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const BoardPage = (props: Props): JSX.Element => {
}

Utils.log(`attachToBoard: ${boardId}`)
if (!viewId && boardViews.length > 0) {
const viewIsFromBoard = boardViews.some((view) => view.id === viewId)
if ((!viewId || !viewIsFromBoard) && boardViews.length > 0) {
const newPath = generatePath(match.path, {...match.params, boardId, viewId: boardViews[0].id})
history.replace(newPath)
return
Expand Down

0 comments on commit 85ccc05

Please sign in to comment.