Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"identityPoolName": "safestepapp50c8fbb3_identitypool_50c8fbb3",
"version": "1",
"cognitoConfig": {
"identityPoolName": "safestepapp679bebf7_identitypool_679bebf7",
"allowUnauthenticatedIdentities": false,
"resourceNameTruncated": "safest50c8fbb3",
"userPoolName": "safestepapp50c8fbb3_userpool_50c8fbb3",
"resourceNameTruncated": "safest679bebf7",
"userPoolName": "safestepapp679bebf7_userpool_679bebf7",
"autoVerifiedAttributes": [
"email"
"email"
],
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS Text Message"
"SMS Text Message"
],
"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
Expand All @@ -18,56 +20,39 @@
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [],
"requiredAttributes": [
"email"
"email",
"name"
],
"aliasAttributes": [],
"userpoolClientGenerateSecret": false,
"userpoolClientRefreshTokenValidity": 30,
"userpoolClientWriteAttributes": [
"email"
"email"
],
"userpoolClientReadAttributes": [
"email"
"email"
],
"userpoolClientLambdaRole": "safest50c8fbb3_userpoolclient_lambda_role",
"userpoolClientLambdaRole": "safest679bebf7_userpoolclient_lambda_role",
"userpoolClientSetAttributes": false,
"sharedId": "50c8fbb3",
"resourceName": "safestepapp50c8fbb350c8fbb3",
"sharedId": "679bebf7",
"resourceName": "safestepapp679bebf7",
"authSelections": "identityPoolAndUserPool",
"authRoleArn": {
"Fn::GetAtt": [
"AuthRole",
"Arn"
]
},
"unauthRoleArn": {
"Fn::GetAtt": [
"UnauthRole",
"Arn"
]
},
"useDefault": "defaultSocial",
"hostedUI": true,
"usernameAttributes": [
"email"
"email"
],
"userPoolGroups": false,
"adminQueries": false,
"triggers": "{}",
"hostedUI": true,
"triggers": {},
"hostedUIDomainName": "safestepapp679bebf7-679bebf7",
"authProvidersUserPool": [
"Facebook",
"Google"
],
"hostedUIProviderMeta": "[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"name\":\"name\",\"username\":\"id\"}},{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"name\":\"name\",\"username\":\"sub\"}}]",
"oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"safestep://\"],\"LogoutURLs\":[\"safestep://\"]}",
"userPoolGroupList": [],
"serviceName": "Cognito",
"usernameCaseSensitive": false,
"parentStack": {
"Ref": "AWS::StackId"
},
"breakCircularDependency": true,
"permissions": [],
"dependsOn": [],
"hostedUIDomainName": "safestepapp909a797a-909a797a",
"authProvidersUserPool": [
"Facebook",
"Google"
],
"hostedUIProviderMeta": "[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"id\"}},{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"sub\"}}]",
"authProviders": [],
"oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"safestep://\"],\"LogoutURLs\":[\"safestep://\"]}"
"useEnabledMfas": false
}
}
28 changes: 26 additions & 2 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
{
"auth": {
"safestepapp50c8fbb350c8fbb3": {
"safestepapp679bebf7": {
"service": "Cognito",
"providerPlugin": "awscloudformation",
"dependsOn": [],
"customAuth": false
"customAuth": false,
"frontendAuthConfig": {
"socialProviders": [
"FACEBOOK",
"GOOGLE"
],
"usernameAttributes": [
"EMAIL"
],
"signupAttributes": [
"EMAIL",
"NAME"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
16 changes: 16 additions & 0 deletions amplify/backend/types/amplify-dependent-resources-ref.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export type AmplifyDependentResourcesAttributes = {
"auth": {
"safestepapp679bebf7": {
"IdentityPoolId": "string",
"IdentityPoolName": "string",
"HostedUIDomain": "string",
"OAuthMetadata": "string",
"UserPoolId": "string",
"UserPoolArn": "string",
"UserPoolName": "string",
"AppClientIDWeb": "string",
"AppClientID": "string",
"CreatedSNSRole": "string"
}
}
}
3 changes: 3 additions & 0 deletions amplify/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
},
"appsync": {
"generategraphqlpermissions": true
},
"project": {
"overrides": true
}
}
}
2 changes: 1 addition & 1 deletion amplify/team-provider-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"categories": {
"auth": {
"safestep2c99166e": {},
"safestepapp50c8fbb350c8fbb3": {}
"safestepapp679bebf7": {}
}
}
}
Expand Down
15 changes: 12 additions & 3 deletions screens/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ import {ResetPassword} from ".";

const App: FC = ({navigation}: any) => {
const [email, setEmail] = useState<string | null>(null);
const [name, setName] = useState<string | null>(null);

const [password, setPassword] = useState<string | null>(null);
const [passwordRepeat, setPasswordRepeat] = useState<string | null>(null);

const [errorMessage, setErrorMessage] = useState<string>("");

const signup = async () => {
if (!email || !password) {
if (!email || !password || !name) {
console.log("error, unfilled inputs");
setErrorMessage("E-mail or Password cannot be empty");
setErrorMessage("Please ensure all fields are filled");
} else if (password != passwordRepeat) {
console.log("error, unmatching password");
setErrorMessage("Password missmatch");
Expand All @@ -36,6 +38,9 @@ const App: FC = ({navigation}: any) => {
const {user} = await Auth.signUp({
username,
password,
attributes: {
name,
},
});
console.log(user);
navigation.navigate("confirm_code", {username: username});
Expand Down Expand Up @@ -70,6 +75,11 @@ const App: FC = ({navigation}: any) => {
placeholder="Email"
onChangeText={text => setEmail(text)}
/>
<Input
label="Name"
placeholder="Name"
onChangeText={text => setName(text)}
/>
<Input
label="Password"
placeholder="Password"
Expand Down Expand Up @@ -108,6 +118,5 @@ const styles = StyleSheet.create({
},
logo: {
marginTop: 30,
marginBottom: 5,
},
});
Loading