* Get a valid token, refreshing if necessary
()
| 86 | * Get a valid token, refreshing if necessary |
| 87 | */ |
| 88 | async getValidToken(): Promise<string | null> { |
| 89 | if (!this.store.isAuthenticated()) { |
| 90 | return null |
| 91 | } |
| 92 | |
| 93 | if (this.store.needsRefresh()) { |
| 94 | await this.refresh() |
| 95 | } |
| 96 | |
| 97 | return this.store.getToken() |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Refresh the current session |
no test coverage detected