Multiple guards support
See original GitHub issueThere is any plan to add multiple guards support for Per-Route Guards?
For the cases where have multiple resolves before access to the route. for example check if user connected, next check if user is active, next check if resource is available… All before go into route.
maybe passing an array of functions to beforeEach and going to the view after the last next. something like
{
path: '/hello',
component: Hello,
beforeEach: [function(from, to, next){
// first check
// ...
next() // goes to seccond check
}, function(from, to, next){
// seccond check
// ...
next() // If last check -> goes to component Hello
}]
}
Would be great
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:32 (8 by maintainers)
Top Results From Across the Web
Using multiple guards | laravel-permission - Spatie
##Using permissions and roles with multiple guards. When creating new permissions and roles, if no guard is specified, then the first defined guard...
Read more >How to use multiple authentication guards in a Laravel app
This tutorial guides you through setting up multiple authentication guard in a Laravel web app. You will provide multiple authentication ...
Read more >Implement Multiple Authentication Guards in Laravel 8
Learn How to Implement Multiple Authentication Guards in Laravel 8 in this step-by-step guide by using separate login and table.
Read more >How to Implement Multiple Authentication Guards in Laravel 9
How to Implement Multiple Authentication Guards in Laravel 9 · Step 1: Install Laravel Project · Step 2: Install Laravel UI · Step...
Read more >Multiple canActivate guards all run when first fails
First of all, angular doesn't support the feature to call the guards in tandem. So if first guard is asynchronous and is trying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If anyone is interested, I just published my implementation of multiple guards: https://www.npmjs.com/package/vue-router-multiguard
To use it you just have to pass your guards array as an argument to multiguard like this:
@posva please consider reopening this issue so it doesn’t get lost.
use case here is:
beforeEnter: [requireAuth, anotherGuard]