mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Fix auto-refresh on 401 in base API service
This commit is contained in:
parent
1690ce1891
commit
a8e8b0e2fd
2 changed files with 20 additions and 3 deletions
|
|
@ -179,8 +179,9 @@ export function getAuthHeaders(additionalHeaders?: Record<string, string>): Reco
|
|||
/**
|
||||
* Attempts to refresh the access token using the stored refresh token.
|
||||
* Returns the new access token if successful, null otherwise.
|
||||
* Exported for use by API services.
|
||||
*/
|
||||
async function refreshAccessToken(): Promise<string | null> {
|
||||
export async function refreshAccessToken(): Promise<string | null> {
|
||||
// If already refreshing, wait for that request to complete
|
||||
if (isRefreshing && refreshPromise) {
|
||||
return refreshPromise;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue