- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
/**
* Refresh JWT.
* @returns New tokens.
*/
static refreshToken(): Observable<BaseResponseInterface<SignInResponse>> {
const http = InjectorInstance.get<HttpClient>(HttpClient);
this.isRefreshingToken = true;
setTimeout(() => (this.isRefreshingToken = false), 15000);
return http
.post<BaseResponseInterface<SignInResponse>>(environment.API.REFRESH_TOKEN, {
accessToken: localStorage.getItem('auth_token'),
refreshToken: localStorage.getItem('refresh_token')
})
.pipe(
tap(response => {
this.isRefreshingToken = false;
this.storeTokens(response.data.token, response.data.refreshToken);
})
);
}
Когда уверен в своем сервере. Или просто сдался.
guest8 06.09.2019 15:46 # −999
Bmopou_nemyx 06.09.2019 16:29 # 0
guest8 06.09.2019 17:02 # −999