admin管理员组文章数量:1402031
i'm working on amplify auth to signin with cognito in vue js apps, following is the code i've 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'm receive this kind of 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 (<anonymous>)
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've tried many ways following the reference video and aws amplify documentation. but still same error still occured and my page is blank with the error in console. checked the Auth option and all was good and right. how do i overe this error? i'm also not using any client secret hash as js sdk not worked with app client with secret hash
i'm working on amplify auth to signin with cognito in vue js apps, following is the code i've 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'm receive this kind of 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 (<anonymous>)
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've tried many ways following the reference video and aws amplify documentation. but still same error still occured and my page is blank with the error in console. checked the Auth option and all was good and right. how do i overe this error? i'm also not using any client secret hash as js sdk not worked with app client with secret hash
Share Improve this question edited Jul 1, 2021 at 9:36 Khairul Habib asked Jul 1, 2021 at 9:04 Khairul HabibKhairul Habib 4712 gold badges13 silver badges32 bronze badges1 Answer
Reset to default 7The config parameter names need to be
...
userPoolId: '...'
userPoolWebClientId: '...'
...
as defined here: https://github./aws-amplify/amplify-js/blob/a047ce73abe98c3bf82e888c3afb4d2f911805f3/packages/auth/src/types/Auth.ts#L40
本文标签: javascriptUncaught Error Both UserPoolId and ClientId are requiredStack Overflow
版权声明:本文标题:javascript - Uncaught Error: Both UserPoolId and ClientId are required - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744346319a2601781.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论