David
David

Reputation: 61

OAuth responses require a User Pool defined in config

I am unable to connect to userpool which I defined right above: Auth is an amplify Object

Auth.configure({
  region: process.env.REACT_APP_AWS_REGION,
  userPoolId: process.env.REACT_APP_PROD_UNIFY_COGNITO_USER_POOL_ID,
  userPoolWebClientId: process.env.REACT_APP_PROD_UNIFY_COGNITO_CLIENT_ID,

  // Cognito Hosted UI configuration
  oauth: {
    domain: process.env.REACT_APP_PROD_UNIFY_COGNITO_DOMAIN,
    scope: ['email', 'openid', 'aws.cognito.signin.user.admin', 'profile'],
    redirectSignIn: 'http://localhost:3000',
    redirectSignOut: 'http://localhost:3000',
    responseType: 'code',
  },
});

I get this error in my browser :Unhandled Rejection (Error): OAuth responses require a User Pool defined in config AuthClass. What else is there to connecting programmatically to a user pool. I didn't do amplify push,add auth or anything with the amplify cli b/c I don't think it's necessary?

Upvotes: 3

Views: 2608

Answers (1)

FullStackFool
FullStackFool

Reputation: 1160

This is most often down to the fact that you have changed your .env file, but not stopped and restarted your local web server.

For instance if you use yarn serve, make sure you stop the process, then update your .env, then yarn serve again.

Upvotes: 2

Related Questions