Add JSDoc documentation and file headers to all source files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
// The Lucia project.
|
||||
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
||||
// Authors:
|
||||
// imacat.yang@dsp.im (imacat), 2023/9/23
|
||||
/** @module auth Authentication token refresh utilities. */
|
||||
|
||||
import axios from 'axios';
|
||||
import { getCookie, setCookie, setCookieWithoutExpiration } from '@/utils/cookieUtil.js';
|
||||
|
||||
/**
|
||||
* Refresh the access token using the refresh token cookie.
|
||||
* Uses plain axios (not apiClient) to avoid interceptor loops.
|
||||
* Refreshes the access token using the stored refresh token cookie.
|
||||
*
|
||||
* Uses plain axios (not apiClient) to avoid interceptor loops. Updates
|
||||
* both the access token (session cookie) and refresh token (6-month
|
||||
* expiry) cookies.
|
||||
*
|
||||
* @returns {Promise<string>} The new access token.
|
||||
* @throws {Error} If the refresh request fails.
|
||||
*/
|
||||
export async function refreshTokenAndGetNew() {
|
||||
const api = '/api/oauth/token';
|
||||
|
||||
Reference in New Issue
Block a user