Closed jlui17 closed 1 month ago
Okay now that we have a basic endpoint and handler, let's add some security measures and clean up some things :)
PR (part 1, 2): https://github.com/jlui17/W2FHR/pull/2
Final step is to use this endpoint in the frontend. We will have to make a few changes to the LoginSignupController
.
onSignup
to call our API endpoint with the right parameters
woopies I took a while 👎, but currently LoginSignUpController works but does not send a verification code because it is not implemented yet.
Okay wonderful. Let's implement the verification step now, meaning the front and back-end part. After that, we can merge this and deploy it :)
woops its been a while, but I've been so lost on why its sending a code on verification even though I traced through the code to find where it would send a verification code but I didn't even implement it. LoginSignUp and authentication, but its working ??
I think what's happening is that SignUp from the AWS SDK sends a verification code if successful. The verification only needs to be implemented if, for example, the user doesn't confirm right after they sign up, and needs to get another verification code sent.
I think what we need:
POST /verify
endpoint that takes a verification code and confirms the userGET /verify?email={email}
endpoint that sends a verification code to that email if they're registered but not confirmed Was a big PR, but JZ did a good job :) https://github.com/jlui17/W2FHR/pull/6
@zhaojzn
User Story
As a dev, I want a callable API to create users for the app so that I don't have to worry about authentication flow on the frontend.
Requirements
We want to send a
POST
request to the/auth
endpoint with the following data in the request, which will create a user:This will create a user and return a response like this:
Context
/auth
endpoint of the ApiGateway.Guide
main
to work on. Branches are like copies of the code that you branch off from, so that you can do whatever you like to it without affecting the main version./auth
endpoint, make sure I can send requests and get responses.go get "github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
."github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
to your import statement in the go file.UserConfirmed
boolean in the body of the API response.