Giter Club home page Giter Club logo

Comments (5)

scotthenninger avatar scotthenninger commented on August 27, 2024 1

Thanks for all your help @ottokruse. Either redeploying or setting WS_EMAIL (I had forgotten this step in my previous iteration) did the trick.

Thanks again for your help and for writing up this example!

from amazon-cognito-passwordless-auth.

ottokruse avatar ottokruse commented on August 27, 2024

Hi @scotthenninger

If I use the e-mail option it takes me to another challenge window. Is this expected behavior?

Can't follow this exactly yet, can you share screen shots or a short video clip?

The UI did change a bit since the workshop was released so screen shots may be slightly outdated: you first enter your e-mail address now and then proceed to the 2nd screen where you have to click "sign in with magic link". Other than that it's all still the same.

Is there some place I should have set the redirect URI?

When running the workshop:

  • Make sure to set the right environment variables, following the instructions here
  • Use the env var WS_PREVIEW_URL as allowed origin in the CDK construct: link

Hope that helps.

from amazon-cognito-passwordless-auth.

scotthenninger avatar scotthenninger commented on August 27, 2024

Hello @ottokruse;

Thanks for the explanation on the UI - that is the behavior I'm seeing. In terms of the invalid redirect I'm attaching the UI and a screen shot of the console. The environment variables check out as stated in the workshop and the URL seems to be the same as the WS_PREVIEW_URL so I'm not entirely clear why the redirect error occurs. Any hints or further suggestions would be appreciated.

And thanks!
Screenshot 2024-01-22 at 4 42 09 PM
Screenshot 2024-01-22 at 4 37 45 PM

from amazon-cognito-passwordless-auth.

ottokruse avatar ottokruse commented on August 27, 2024

That error is thrown by backend code:

// Determine the redirect URI for the magic link
const redirectUri = event.request.clientMetadata?.redirectUri;
if (
!redirectUri ||
!requireConfig("allowedOrigins").includes(new URL(redirectUri).origin)
) {
throw new UserFacingError(`Invalid redirectUri: ${redirectUri}`);
}

Can you double check that you used the WS_PREVIEW_URL as allowedOrigin when instantiating the CDK construct? Should be in this step: link

If that looks good, try redeploying. You can also check the Lambda function in the AWS console, and verify that its environment variable ALLOWED_ORIGINS includes the value from WS_PREVIEW_URL (https://67fc3ff145d745d2b32f69eb454f9f3d.vfs.cloud9.us-east-1.amazonaws.com)

from amazon-cognito-passwordless-auth.

ottokruse avatar ottokruse commented on August 27, 2024

Nice!

from amazon-cognito-passwordless-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.