Skip to content

Commit

Permalink
refactor: simplify CreateSigninRequestArgs interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Apr 13, 2023
1 parent cdde5e0 commit d57dbf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 56 deletions.
36 changes: 1 addition & 35 deletions docs/oidc-client-ts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,14 @@ export class CheckSessionIFrame {
}

// @public (undocumented)
export interface CreateSigninRequestArgs {
// (undocumented)
acr_values?: string;
// (undocumented)
client_secret?: string;
// (undocumented)
display?: string;
// (undocumented)
extraQueryParams?: Record<string, string | number | boolean>;
// (undocumented)
extraTokenParams?: Record<string, unknown>;
// (undocumented)
id_token_hint?: string;
// (undocumented)
login_hint?: string;
// (undocumented)
max_age?: number;
// (undocumented)
nonce?: string;
// (undocumented)
prompt?: string;
export interface CreateSigninRequestArgs extends Omit<SigninRequestArgs, "url" | "authority" | "client_id" | "redirect_uri" | "response_type" | "scope" | "state_data"> {
// (undocumented)
redirect_uri?: string;
// (undocumented)
request?: string;
// (undocumented)
request_type?: string;
// (undocumented)
request_uri?: string;
// (undocumented)
resource?: string | string[];
// (undocumented)
response_mode?: "query" | "fragment";
// (undocumented)
response_type?: string;
// (undocumented)
scope?: string;
// (undocumented)
skipUserInfo?: boolean;
state?: unknown;
// (undocumented)
ui_locales?: string;
}

// @public (undocumented)
Expand Down
28 changes: 7 additions & 21 deletions src/OidcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OidcClientSettings, OidcClientSettingsStore } from "./OidcClientSetting
import { ResponseValidator } from "./ResponseValidator";
import { MetadataService } from "./MetadataService";
import type { RefreshState } from "./RefreshState";
import { SigninRequest } from "./SigninRequest";
import { SigninRequest, SigninRequestArgs } from "./SigninRequest";
import { SigninResponse } from "./SigninResponse";
import { SignoutRequest, SignoutRequestArgs } from "./SignoutRequest";
import { SignoutResponse } from "./SignoutResponse";
Expand All @@ -19,31 +19,14 @@ import { ClaimsService } from "./ClaimsService";
/**
* @public
*/
export interface CreateSigninRequestArgs {
export interface CreateSigninRequestArgs
extends Omit<SigninRequestArgs, "url" | "authority" | "client_id" | "redirect_uri" | "response_type" | "scope" | "state_data"> {
redirect_uri?: string;
response_type?: string;
scope?: string;
nonce?: string;

/** custom "state", which can be used by a caller to have "data" round tripped */
state?: unknown;

prompt?: string;
display?: string;
max_age?: number;
ui_locales?: string;
id_token_hint?: string;
login_hint?: string;
acr_values?: string;
resource?: string | string[];
response_mode?: "query" | "fragment";
request?: string;
request_uri?: string;
extraQueryParams?: Record<string, string | number | boolean>;
request_type?: string;
client_secret?: string;
extraTokenParams?: Record<string, unknown>;
skipUserInfo?: boolean;
}

/**
Expand All @@ -57,7 +40,10 @@ export interface UseRefreshTokenArgs {
/**
* @public
*/
export type CreateSignoutRequestArgs = Omit<SignoutRequestArgs, "url" | "state_data"> & { state?: unknown };
export type CreateSignoutRequestArgs = Omit<SignoutRequestArgs, "url" | "state_data"> & {
/** custom "state", which can be used by a caller to have "data" round tripped */
state?: unknown;
};

/**
* @public
Expand Down

0 comments on commit d57dbf3

Please sign in to comment.