2

I'm pretty new to Amplify, I've been using it via both the amplify-cli and aws console for the last month and a half or so and have learnt a lot along the way. Recently however I've come across a problem that no one else seems to be having (that I can find from searching on the internet).

I've setup my React project which uses 3 major services from aws:

  • Cognito (for authentication) (standard and federated login [Google, Facebook])
  • Lambda functions (autogenerate by the amplify-cli for email verification)
  • GraphQL API added via the cli as well

Those are the three main services included in my app.

For some odd reason, in the past few days when I implement the signup authentication, and the user receives the verification email and I click on the verification link I NOW get this error:

Screenshot of verification link being clicked

This never used to be the case, and used to work perfectly. Since then I have wiped all the backend resources a number of times, and even built the entire amplify project from scratch, but I still keep getting that error.

This is part of my parameters.json file (inside amplify directory)

 "verificationBucketName": "hulpio17b04d80verificationbucket",
    "parentStack": {
        "Ref": "AWS::StackId"
    },
    "permissions": [],
    "dependsOn": [
        {
            "category": "function",
            "resourceName": "hulpio17b04d80CustomMessage",
            "triggerProvider": "Cognito",
            "attributes": [
                "Arn",
                "Name"
            ]
        }
    ],

Below is a screenshot of my s3 buckets on the aws console:

s3 bucket listing

I've tried a number of things, but for the life of me I can't understand why this error is still coming up, even after I've wiped everything and started from scratch.

P.S my app is hosted in Ireland eu-west-1 so all the services I use are hosted there, except s3 buckets which is apparently global and not localised to a single area.

1 Answers1

1

So, I have a small update, but its not a full solution.

More of a hack really.

inside the verification-link.js file, I made a change to one line

const bucketUrl = `http://${resourcePrefix}verificationbucket-${process.env.ENV}.s3-website${seperator}${region}.amazonaws.com`;

I manually changed this to

const bucketUrl = `http://hulpio17b04d80verificationbucket-${process.env.ENV}.s3-website${seperator}${region}.amazonaws.com`;

And this time when I clicked on the verification URL it started working.

Now while this is great, and I could hack this, I of course don't think that's a good long term solution. It seems that for some reason the resource prefix is not being passed down to verification-link.js

I'm still searching, and any help on this is still very much welcome.

Thanks in advance!