I am new in VueJS and Amazon-cognito and trying to sign in using my simple VueJS application.
I am using NPM and webpack. I have followed the steps from amazon-cognito-auth-js
Below is my script tag.
<script>
import {CognitoAuth} from amazon-cognito-auth-js/dist/amazon-cognito-auth
export default {
name: 'App',
methods: {
initCognitoSDK: function() {
var authData = {
AppWebDomain: 'XXX.auth.us-west-2.amazoncognito.com',
TokenScopesArray: ['phone', 'email', 'profile', 'openid'],
AdvancedSecurityDataCollectionFlag: false,
ClientId: 'XXXXXXXXXXXXXXXXXXXXXXX',
RedirectUriSignIn: 'http://localhost:8080/index.html',
RedirectUriSignOut: 'http://localhost:8080/sign-out.html'
};
var auth = new CognitoAuth(authData);
auth.userhandler = {
onSuccess: function (result) {
alert("Sign in success");
//showSignedIn(result);
console.log(result);
},
onFailure: function (err) {
alert("Error!" + err);
}
};
return auth;
}
}
}
</script>
I am unable to see the alert of neither success nor failure. Any help will be highly appreciated!