fix auth and move logic to router #1201
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1201
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/fix-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
414a5d6aa0
toc09cafbe6c
Hi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1201-featurefix-auth--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
@ -64,21 +64,25 @@ const route = useRoute()
// hide menu on mobile
watch(() => route.fullPath, () => window.innerWidth < 769 && store.commit(MENU_ACTIVE, false))
// FIXME: this is really error prone
What makes it error prone?
Also why is this here and in the router definition file?
It's not the same.
This seems to be a list of the routes where the currentList should be resetted.
It seems error prone because it is defined somewhere where you would not think of when creating a new view that does not have anything to do if the currentList.
Probably it would be better to reset the currentList always and then only set it again in the pages where there is one. What do you think?
Or have a route meta field where we define if the currentList is used. So my thought here is: instead of opting out the views should opt in that they want to show the currentList.
Then we do not need to reset it (I think) but can simply not show it.
Regardless this pull request was intended as a quick fix. The above would be another issue.
@ -0,0 +575,4 @@
],
})
router.beforeEach((to) => {
Seems like this is much better!
The stuff with router.resolve was just meant as an example for the error pages.
But when I read it I thought it was needed for them to work :D
Gladly the
resolve
function just looks up stuff and returns it (to nothing in this case) so it also didn't hurt :DWhat's blocking this PR from being ready for merge? Looks fine to me.
WIP: fix auth and move logic to routerto fix auth and move logic to routerMany tests fail :/
Seems to be a timing issue created by the additional time that is needed to check if a user is authorized to access each page :/
It's too many tests that fail right now. Any idea @konrad?
It looks more like an issue with the notification library. All tests that fail assert that some global notification is shown after an action and that does not happen. I'm not sure why that would happen, the notification message seems to be correctly put together.
The notification does not get shown at all (and that makes the tests fail) but the rest seems to be working fine.
@ -7,4 +7,2 @@
</template>
<content-link-share v-else-if="authLinkShare"/>
<content-no-auth v-else/>
<notification/>
Uhm maybe we should add that back in? Maybe that's why the tests all fail?
No notification component -> no notifications -> tests unable to assert notifications present
#fail