chore: add changesets, update API reports, fix type errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Roebuck <jroebuck@spotify.com>
This commit is contained in:
@@ -293,7 +293,10 @@ export interface OAuthAuthenticator<TContext, TProfile> {
|
||||
// (undocumented)
|
||||
initialize(ctx: { callbackUrl: string; config: Config }): TContext;
|
||||
// (undocumented)
|
||||
logout?(input: OAuthAuthenticatorLogoutInput, ctx: TContext): Promise<void>;
|
||||
logout?(
|
||||
input: OAuthAuthenticatorLogoutInput,
|
||||
ctx: TContext,
|
||||
): Promise<void | OAuthAuthenticatorLogoutResult>;
|
||||
// (undocumented)
|
||||
refresh(
|
||||
input: OAuthAuthenticatorRefreshInput,
|
||||
@@ -329,6 +332,11 @@ export interface OAuthAuthenticatorLogoutInput {
|
||||
req: Request_2;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface OAuthAuthenticatorLogoutResult {
|
||||
logoutUrl?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface OAuthAuthenticatorRefreshInput {
|
||||
// (undocumented)
|
||||
|
||||
@@ -1265,7 +1265,7 @@ describe('createOAuthRouteHandlers', () => {
|
||||
});
|
||||
|
||||
it('should return logoutUrl as JSON when authenticator provides one', async () => {
|
||||
mockAuthenticator.logout.mockResolvedValueOnce({
|
||||
(mockAuthenticator.logout as jest.Mock).mockResolvedValueOnce({
|
||||
logoutUrl: 'https://example.auth0.com/v2/logout?federated',
|
||||
});
|
||||
|
||||
@@ -1293,7 +1293,7 @@ describe('createOAuthRouteHandlers', () => {
|
||||
});
|
||||
|
||||
it('should return empty body when authenticator logout returns void', async () => {
|
||||
mockAuthenticator.logout.mockResolvedValueOnce(undefined);
|
||||
(mockAuthenticator.logout as jest.Mock).mockResolvedValueOnce(undefined);
|
||||
|
||||
const agent = request.agent(
|
||||
wrapInApp(createOAuthRouteHandlers(baseConfig)),
|
||||
|
||||
@@ -280,7 +280,7 @@ export function createOAuthRouteHandlers<TProfile>(
|
||||
throw new AuthenticationError('Invalid X-Requested-With header');
|
||||
}
|
||||
|
||||
let logoutResult: void | { logoutUrl?: string };
|
||||
let logoutResult: void | { logoutUrl?: string } = undefined;
|
||||
if (authenticator.logout) {
|
||||
const refreshToken = cookieManager.getRefreshToken(req);
|
||||
logoutResult = await authenticator.logout(
|
||||
|
||||
Reference in New Issue
Block a user