serhiisol / ngx-auth

Angular 16+ Authentication Module
MIT License
234 stars 47 forks source link

Private guard remember URL #28

Closed smnbbrv closed 6 years ago

smnbbrv commented 6 years ago

Hi,

the library is super, thank you for supporting this!

Question: is it possible to remember the URL that was attempted to be loaded and redirect to this URL after user logs in without extending / replacing the original ProtectedGuard?

This is dumb, but quite an important feature; it is even available in Angular guides: https://angular.io/guide/router#teach-authguard-to-authenticate

serhiisol commented 6 years ago

well, in theory you can extend ProtectedGuard and provide your own guard instead, like so:

{
  provide: ProtectedGuard,
  useClass: MyNewProtectedGuard
}

But otherwise, that might be a good addition to the library.