nebular
nebular copied to clipboard
NbDummyAuthStrategy missing option to set redirect path
Issue type
I'm submitting a ... (check one with "x")
- [ ] bug report
- [x] feature request
Issue description
Current behavior:
NbDummyAuthStrategy has no option to set redirect path after "successful" login. Hardcoded value redirects to /.
https://github.com/akveo/nebular/blob/master/src/framework/auth/strategies/dummy/dummy-strategy.ts#L67
return new NbAuthResult(true, this.createSuccessResponse(data), '/', [], ['Successfully logged in.'], token);
Expected behavior:
redirect option could be set if needed, as example:
export class NbDummyAuthStrategyOptions extends NbAuthStrategyOptions {
token?: NbStrategyToken = {
class: NbAuthSimpleToken,
};
delay?: number = 1000;
alwaysFail?: boolean = false;
redirect?: string = '/';
}
Related code: https://github.com/akveo/nebular/blob/master/src/framework/auth/strategies/dummy/dummy-strategy-options.ts https://github.com/akveo/nebular/blob/master/src/framework/auth/strategies/dummy/dummy-strategy.ts