Title rewritten to: Missing error message: UserPoolId and ClientId are missing
P粉166675898
P粉166675898 2023-11-06 19:36:03
0
1
521

I'm looking into using cognito for amplify authentication in a vue js application, here is the code I added in main.js:

import Amplify from 'aws-amplify'; Amplify.configure({ Auth: { mandatorySignIn: false, region: config.cognito.REGION, userPoolId: config.cognito.USER_POOL_ID, UserPoolClientId: config.cognito.APP_CLIENT_ID, }, });

But somehow I got this error:

CognitoUserPool.js?17a7:46 Uncaught Error: Both UserPoolId and ClientId are required. at new CognitoUserPool (CognitoUserPool.js?17a7:46) at AuthClass.configure (Auth.js?bf82:183) at eval (Amplify.js?7d03:83) at Array.map () at AmplifyClass.configure (Amplify.js?7d03:82) at eval (main.js?56d7:15) at Module../src/main.js (app.js:1692) at __webpack_require__ (app.js:854) at fn (app.js:151) at Object.1 (app.js:2809)

I tried multiple methods following the reference video and aws amplify documentation. But still the same error occurs, my page is blank and error appears in the console. Checked the Auth options and all is good. How can I overcome this error? I'm also not using any client side secret hash because the js sdk doesn't work with the app client with a secret hash

P粉166675898
P粉166675898

reply all (1)
P粉828463673

The name of the configuration parameter needs to be as follows:

... userPoolId: '...' userPoolWebClientId: '...' ...

Define here:https://github.com/aws-amplify/amplify-js/blob/a047ce73abe98c3bf82e888c3afb4d2f911805f3/packages/auth/src/types/Auth.ts#L40

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!