Comments (10)
@jarredszabadi, @nsankaranarayanan you can just set the logout endpoint to empty string and it won't hit the endpoint and simply clear the token:
providers: {
email: {
...
config: {
logout: {
endpoint: '',
},
},
},
},
from nebular.
Hi guys,
you can inject the NbTokenService and clear the data with this.nbTokenService.clear(); like this:
constructor(private sidebarService: NbSidebarService
private nbTokenService:NbTokenService) {
}
logout(){
this.nbTokenService.clear()
}
from nebular.
@ynotLeft
Maybe you won't reach the end point?
Try adding this to core.module.ts
from nebular.
Premature ask. Copied source files and will modify my settings there.
from nebular.
Is this possible without copying the source files?
from nebular.
I don't believe so but it made sense for me to copy the auth files as I did some extra customizations.
BUUTTT
by looking at their source code in token.service.ts you can see that the token is stored in local storage with a key 'auth_app_token'.
Should you want you can clear the token yourself when a user logs out in your app localStorage.removeItem('auth_app_token');
from nebular.
mmmmmm so much better. thanks
from nebular.
I'm trying to use logout method in both NbEmailPassAuthProvider and my custom provider.
Maybe I am missing something, but NbAuthService aways skips code inside switchMap()
I get the Observable form NbEmailPassAuthProvider (var test
). Then the pipe and switchMap are skipped and I go right to the return test2
.
So token is not being deleted and I am not redirected.
Any help would be appreciated
from nebular.
export class NgxLoginComponent extends NbLoginComponent implements OnInit {
ngOnInit() {
this.token.clear();
}
get token(): NbTokenService {
return InjectorHelper.injector.get(NbTokenService);
}
}
from nebular.
The logout
method returns an observable
, so you need to subscribe
to it to call it.
from nebular.
Related Issues (20)
- Angular/Nebular upgrade styling not working properly HOT 1
- Nb Stepper Long Names Overlapping on Horizontal Alignment
- #nebular
- Support for Angular 17 HOT 4
- Install Nebular theme error -> Could not read Angular module file: /src/[object Object].ts HOT 8
- [Calendar] [DatePicker] components aren't translated when switching languages HOT 1
- nb-tabset not workign with ng-content
- The Nebular Dropdown (nbSelect) remains open and does not collapse when scrolling the page. HOT 1
- caught error defaultview
- error handling when serve the project(ng serve) I'm using angular 12th version
- logout
- logout
- pipe table
- Theme is not a map.
- Could not read Angular module file: /src/null.ts (Standalone) or /src/[object Object].ts (ng modules) HOT 6
- Docs: latest version 9.0.0 but appear to have version 13 installed HOT 2
- NbTreeGrid Error NullInjectorError: No provider for InjectionToken CDK_TABLE! HOT 9
- RangePicker only Month and Year
- Request for Multiline Input Support in <nb-chat-from> Component
- angular/[email protected]: [ERROR] TS2610 in NbTable HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nebular.