Skip to content

Instantly share code, notes, and snippets.

@rheinardkorf
Last active August 15, 2019 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rheinardkorf/b26340f0ba2bafc0ac9125d2d4d12619 to your computer and use it in GitHub Desktop.
Save rheinardkorf/b26340f0ba2bafc0ac9125d2d4d12619 to your computer and use it in GitHub Desktop.

First attempt...

Inside gatsby-browser.js

import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './src/aws-exports'
Amplify.configure(awsconfig);

ISSUE: Could not find Cognito User Pool.

Manual config

Inside gatsby-browser.js

import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './src/aws-exports'
Amplify.configure({
    Auth: {
        identityPoolId: awsconfig.aws_cognito_identity_pool_id,
        region: awsconfig.aws_project_region,
        identityPoolRegion: awsconfig.aws_cognito_region,
        userPoolId: awsconfig.aws_user_pools_id,
        userPoolWebClientId: awsconfig.aws_user_pools_web_client_id,
    }
});

PROBLEM SOLVED!


Documentation followed: https://aws-amplify.github.io/docs/js/authentication

@rheinardkorf
Copy link
Author

This was with Amplify v1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment