Skip to content

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jjarvisp committed Feb 26, 2025
1 parent 0b19daf commit c91adb0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { Authenticator } from '@aws-amplify/ui-react-native';
import { StyleSheet, View } from 'react-native';
import {
Authenticator,
AuthenticatorProps,
} from '@aws-amplify/ui-react-native';
import { Amplify } from 'aws-amplify';

import { SignOutButton } from '../SignOutButton';
import awsConfig from './aws-exports';
import { AuthContext } from '@aws-amplify/ui';

Amplify.configure(awsConfig);

const customServices: AuthContext['services'] = {
const customServices: AuthenticatorProps['services'] = {
handleSignIn: async () => {
return {
isSignedIn: false,
Expand All @@ -35,7 +37,7 @@ const customServices: AuthContext['services'] = {
};
}

if (/^\d{6}$/.test(challengeResponse)) {
if (challengeResponse === '123456') {
return {
isSignedIn: true,
nextStep: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { Authenticator } from '@aws-amplify/ui-react-native';
import { StyleSheet, View } from 'react-native';
import {
Authenticator,
AuthenticatorProps,
} from '@aws-amplify/ui-react-native';
import { Amplify } from 'aws-amplify';

import { SignOutButton } from '../SignOutButton';
import { AuthContext, emailRegex } from '@aws-amplify/ui';
import awsConfig from './aws-exports';

Amplify.configure(awsConfig);

const customServices: AuthContext['services'] = {
const customServices: AuthenticatorProps['services'] = {
handleSignIn: async () => {
return {
isSignedIn: false,
Expand All @@ -29,7 +31,7 @@ const customServices: AuthContext['services'] = {
},
};
}
if (emailRegex.test(challengeResponse)) {
if (challengeResponse.includes('@example.com')) {
return {
isSignedIn: false,
nextStep: {
Expand All @@ -42,7 +44,7 @@ const customServices: AuthContext['services'] = {
},
};
}
if (/^\d{6}$/.test(challengeResponse)) {
if (challengeResponse === '123456') {
return {
isSignedIn: true,
nextStep: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { Authenticator } from '@aws-amplify/ui-react-native';
import { StyleSheet, View } from 'react-native';
import {
Authenticator,
AuthenticatorProps,
} from '@aws-amplify/ui-react-native';
import { Amplify } from 'aws-amplify';

import { SignOutButton } from '../SignOutButton';
import awsConfig from './aws-exports';
import { AuthContext } from '@aws-amplify/ui';

Amplify.configure(awsConfig);

const customServices: AuthContext['services'] = {
const customServices: AuthenticatorProps['services'] = {
handleSignIn: async () => {
return {
isSignedIn: false,
Expand All @@ -25,7 +27,7 @@ const customServices: AuthContext['services'] = {
};
},
handleConfirmSignIn: async ({ challengeResponse }) => {
if (/^\d{6}$/.test(challengeResponse)) {
if (challengeResponse.includes('@example.com')) {
return {
isSignedIn: true,
nextStep: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';

import { DefaultRadioFormFieldsProps } from './types';

import { Radio, RadioGroup } from '../../../primitives';
import { RadioGroup } from '../../../primitives/RadioGroup';
import { Radio } from '../../../primitives/Radio';

const DefaultSelectMfaTypeFormFields = ({
fields = [],
Expand Down

0 comments on commit c91adb0

Please sign in to comment.