Skip to content

Commit 5d7c1b7

Browse files
author
Ashwin Kumar
committed
Error in signInWithRedirect.ts - add AtLeastOne type to auth
1 parent 36de0bb commit 5d7c1b7

File tree

1 file changed

+6
-1
lines changed
  • packages/core/src/singleton/Auth

1 file changed

+6
-1
lines changed

packages/core/src/singleton/Auth/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ export type AuthConfigUserAttributes = Partial<
9797
Record<AuthStandardAttributeKey, { required: boolean }>
9898
>;
9999

100-
export type AuthConfig = StrictUnion<
100+
type AtLeastOne<T, U = { [K in keyof T]: Pick<T, K> }> = Partial<T> &
101+
U[keyof U];
102+
103+
export type cognitoProviderConfig = StrictUnion<
101104
| AuthIdentityPoolConfig
102105
| AuthUserPoolConfig
103106
| AuthUserPoolAndIdentityPoolConfig
104107
>;
105108

109+
export type AuthConfig = AtLeastOne<cognitoProviderConfig>;
110+
106111
type UnionKeys<T> = T extends T ? keyof T : never;
107112
type StrictUnionHelper<T, TAll> = T extends any
108113
? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>>

0 commit comments

Comments
 (0)