akveo / akveo/nebular

NbPasswordAuthStrategy private injection of ActivatedRoute should be protected instead

Aperta
#2,788 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
8.1k
Fork
1.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Issue type

**I'm submitting a ...** (check one with "x")

* [ ] bug report
* [*] feature request

### Issue description

**Current behavior:**
I can't simply override `NbPasswordAuthStrategy.resetPassword()` since it uses `this.route`, which is marked as a private import. Thereof I had to write the following nasty workaround:

```
export class CustomAuthStrategy extends NbPasswordAuthStrategy {

constructor(
protected http: HttpClient,
protected protectedRoute: ActivatedRoute,
) {
super(http, protectedRoute);
}

resetPassword(data: any = {}): Observable {
...
}
}
```

**Expected behavior:**
I'd like to be able to override any method on `NbPasswordAuthStrategy` seamlessly without having to write the above mentioned workaround.

**Steps to reproduce:**
Try to extend `NbPasswordAuthStrategy` and override a method that uses `this.route` e.g. `resetPassword()`

**Related code:**

https://github.com/akveo/nebular/blob/14088dc111197a789e69e8600119b2e8dcd10974/src/framework/auth/strategies/password/password-strategy.ts#L151

### Other information:

I'm looking to find out here it there is a good reason for this injects to be `private`, otherwise I'll be happy to create a PR once someone confirms this is a wanted behavior.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.