@wristband/nextjs-auth
Version:
SDK for integrating your Next.js application with Wristband. Handles user authentication, session management, and token management.
14 lines (13 loc) • 734 B
TypeScript
import { TokenData } from '../../types';
import { WristbandService } from '../../wristband-service';
/**
* Refreshes an access token if it has expired.
*
* @param refreshToken - The refresh token to use
* @param expiresAt - When the current access token expires (milliseconds since epoch)
* @param wristbandService - Service instance to make the token refresh request
* @param tokenExpirationBuffer - Optional buffer time in seconds
* @returns New token data if refreshed, null if not expired yet
* @throws {WristbandError} if refresh fails
*/
export declare function refreshExpiredToken(refreshToken: string, expiresAt: number, wristbandService: WristbandService, tokenExpirationBuffer?: number): Promise<TokenData | null>;