akveo / akveo/nebular

NbDummyAuthStrategy missing option to set redirect path

未關閉
#3,045 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
8.1k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

### 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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。