Questions tagged [canactivate]

145 questions
0
votes
1 answer

ruby on rails activate post on typical date

i want to activate a post in typical date(which is scheduled by user) and update data in model for example. Post schema t.string :title t.text :body t.datetime :valid_from t.datetime :valid_until t.string :act_status, default: "padding #["pending",…
lee
  • 21
  • 4
0
votes
1 answer

Angular2 Guard called before request finished

I have an angular2 project, I blocked some route components by using 'canActivate' Guard For example: The guard check if the user is logged in and block components for registered users only. But, I have a problem with the timing of the guard…
zeevblu
  • 1,059
  • 2
  • 11
  • 26
0
votes
2 answers

Angular 2 router canActivate Auth Guard

I've been searching for this for last 4 hours and couldn't find any answers. I have several Authguards written, and i want to be able to tell router that if some of them are true it should give permission, but angular 2 router checks if every guard…
nikagar4
  • 830
  • 4
  • 11
  • 23
0
votes
0 answers

Angular2 get if router has canActivate()

hi I need to detect in my if rout has canActivate, but can't find how to do that. service` canActivate() { this.userLogedin = localStorage.getItem('AUTHENTICATION'); //I need check here if rout has canActivate if…
Aram Mkrtchyan
  • 2,690
  • 4
  • 31
  • 47
-1
votes
1 answer

Angular route throws 500 Internal server error on refresh the page when I remove the canActivate from the route

I am having an angular 11 app. It throws a 500 internal server error on the route when I refresh the page. This started to happen when I remove the "canActivate" from the route. This only happens on deployed environment but not in local. { path:…
Iishfaaq Ismath
  • 77
  • 1
  • 11
-1
votes
1 answer

Cannot find name 'canActivate'

Guys i'm trying to make a auth guard to guard routes that someone who isnt authenticated cannot access. In my AuthService i imported Can Activate like this: import { CanActivate, ActivatedRouteSnapshot } from '@angular/router'; I also used the…
-1
votes
2 answers

Angular RouteGuard "A function whose declared type is neither 'void' nor 'any' must return a value"

I have a route guard that checks if a user has access to a resource, before proceeding. After the subscription, I check if the user has access, and if not, redirect using parseUrl or return true. @Injectable({ providedIn: 'root' }) export class…
Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
-1
votes
1 answer

canActivate guard is not triggered for one component in Angular 5.1 app

In my Angular 5.1.1 application, the canActivate guard on a single component is not triggered. When I route to 'user' the AuthenticationGuard is never triggered, but it works for all other paths. I thought that it has something to do with that…
NiAu
  • 535
  • 1
  • 12
  • 32
-1
votes
1 answer

How to routing in component when use AuthGuard in Nativescript

I'm using nativescript-urlhandler in my Nativescript Aplication. When I put a router, my application routing in first in LoginFirstComponent and in second in ResetPassIdComponent that I want. I want to routing directly to component that I…
web site
  • 99
  • 8
-2
votes
1 answer

Angular 8 Guards from link url or from browser url

Is there any way to detect if someone tries to click a link on the already opened site or try to enter for first time the site from canActivate guard?
Michalis
  • 6,686
  • 13
  • 52
  • 78
1 2 3
9
10