INNER CODE UNIT · TypeScript
baseSignedOut
aws-devtools-labs/aws-blocks · packages/bb-auth-cognito/src/index.ts:1735
const baseSignedOut = (error?: string, errorName?: string): AuthState =>
signedOut({
selfSignUp: this.options.selfSignUp ?? true,
userAttributes: this.options.userAttributes ?? [],
enablePasskeys,
signInWith: this.options.signInWith,
error,
errorName,
});
const baseSignedIn = (user: CognitoUser<O>): AuthState =>
signedInState(user, { enablePasskeys });
return new ApiNamespace(this, 'auth', (context) => ({
getAuthState: async (): Promise<AuthState> => {
const user = await this.getCurrentUser(context);
return user ? baseSignedIn(user) : baseSignedOut();
},
setAuthState: async (input: AuthActionInput): Promise<AuthState> => {