akveo / akveo/nebular

refresh_token key on login??

Open
#1,274 3 comments 0 reactions 0 assignees View on GitHub
module:auth needs docs
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Hey! It is rather more a question than an issue, but I haven't find a place where to ask, so I'm asking it here.

I have an endpoint, which returns a json object with keys in case of successful login:
```
{
token: "string",
refresh_token: "string"
}
```

I have configured the app using the next code:

```
export const NB_CORE_PROVIDERS = [
...DataModule.forRoot().providers,
...NbAuthModule.forRoot({

strategies: [
NbPasswordAuthStrategy.setup({
name: 'email', // email
baseEndpoint: 'https://mydomain.com/api',
login: {
endpoint: '/login',
method: 'post',
defaultErrors: ['Wrong combination of email/password!'],
defaultMessages: ['You have successfully logged in!'],
},
token: {
key: 'token',
}
}),
],
forms: {
login: {
back: false,
},
},
}).providers,

NbSecurityModule.forRoot({
accessControl: {
guest: {
view: '*',
},
user: {
parent: 'guest',
create: '*',
edit: '*',
remove: '*',
},
},
}).providers,

{
provide: NbRoleProvider, useClass: NbSimpleRoleProvider,
},
AnalyticsService,
];
```

There is a key that can be set for the `token` key, but there is no way to set a configuration for the `refresh_token` key.
Have I missed something?

The application stores the token and successfully loggs in, but the refresh_token is not stored on successful login.
How do I fix this?

Thank you in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.