Skip to content

Commit

Permalink
Merge pull request #22 from FIAP-Tech-Chalenge/features
Browse files Browse the repository at this point in the history
Features
  • Loading branch information
Perkles authored May 4, 2024
2 parents c469425 + 46e5fa3 commit 2cf67b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ jobs:
- run: sam build
# Prevent prompts and failure when the stack is unchanged
- run: |
sam deploy \
--no-confirm-changeset --no-fail-on-empty-changeset --resolve-s3 \
sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --resolve-s3 \
--parameter-overrides \
USERPOOL_ID=${{ secrets.USERPOOL_ID }} \
CLIENT_ID=${{ secrets.CLIENT_ID }} \
REGION=${{ secrets.REGION }}
UserPoolId=${{ secrets.USERPOOL_ID }} \
ClientId=${{ secrets.CLIENT_ID }} \
Region=${{ secrets.REGION }}
9 changes: 4 additions & 5 deletions authenticate/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

const { CognitoIdentityProviderClient, AdminInitiateAuthCommand, SignUpCommand, AdminGetUserCommand, AdminConfirmSignUpCommand } = require("@aws-sdk/client-cognito-identity-provider");

const userPoolId = process.env.USERPOOL_ID || 'default_value';
const clientId = process.env.CLIENT_ID || 'default_value';
const region = process.env.REGION || 'default_value';
const userPoolId = process.env.UserPoolId || 'default_value';
const clientId = process.env.ClientId || 'default_value';
const region = process.env.Region || 'default_value';
const cognitoClient = new CognitoIdentityProviderClient({region: region});
const senhaPadrao = "Mudar#123"

Expand Down Expand Up @@ -53,8 +53,7 @@ const validaDadosDeEntrada = (event) => {
};
}
try {
body = JSON.parse(event.body);
const {cpf, email} = body
const {cpf, email} = JSON.parse(event.body)
if(!((cpf && cpf != "") && (email && email != ""))) {
return {
statusCode: 400,
Expand Down
6 changes: 3 additions & 3 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Resources:
Method: post
Environment:
Variables:
USERPOOL_ID: ${{ secrets.USERPOOL_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
REGION: ${{ secrets.REGION }}
UserPoolId: ${{ secrets.USERPOOL_ID }}
ClientId: ${{ secrets.CLIENT_ID }}
Region: ${{ secrets.REGION }}

# Outputs:
# # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
Expand Down

0 comments on commit 2cf67b5

Please sign in to comment.