I am using the pre signup lambda trigger in cognito. The pre singup lambda for some cases rasie an exception(desire behaviour). front-end side have the following code:
await Vue.prototype.$auth
.federatedSignIn({
provider: provider
}).then((d) => {
console.log('success ', d)
}).catch((e) => {
console.log('here is and error', e)
})
}
When I run the code I always see the success msg ( d is undefined) in the console.log, right after it I see as well the following msg: I miss to understand how can I catch this error, I guess amplify log it for me, but how can i catch it?
bellow attach my amplify configuration:
import Amplify, { Auth } from 'aws-amplify'
export default {
install (Vue) {
Amplify.configure({
Auth: {
region: config.auth.region,
userPoolId: config.auth.cognitoUserPoolId,
userPoolWebClientId: config.auth.cognitoClientId,
cookieStorage: {
domain: config.auth.cognitoCookieStorageDomain,
secure: config.auth.cognitoCookieStorageSecure
},
mandatorySignIn: false,
authenticationFlowType: 'USER_SRP_AUTH',
oauth: {
domain: config.auth.cognitoDomain,
scope: ['email', 'openid', 'aws.cognito.signin.user.admin'],
redirectSignIn: config.auth.cognitoSignInRedirectUrl,
redirectSignOut: config.auth.cognitoSignOutRedirectUrl,
responseType: 'code' // or 'token', note that REFRESH token will only be generated when the responseType is code
}
}
})
Vue.prototype.$auth = Auth
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment