Skip to content

Commit

Permalink
#20 запоминаем временный токен, чтобы не заставлять пользователя авт…
Browse files Browse the repository at this point in the history
…оризовываться опять
  • Loading branch information
PaulAnnekov committed Jun 16, 2019
1 parent b5db35a commit 51ac207
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ export class UserStore {
this.error = false;
try {
if (this.token) {
this.tempToken = yield this.api.token({
grant_type: 'refresh_token',
refresh_token: this.token.refreshToken,
});
if (!this.tempToken) {
this.tempToken = yield this.api.token({
grant_type: 'refresh_token',
refresh_token: this.token.refreshToken,
});
}
this.keys = yield this.api.keys(this.tempToken);
}
// TODO: Should we support >1 keys?
Expand Down

0 comments on commit 51ac207

Please sign in to comment.