new AWS.AppSync()
does not run in the browser because when loaded in the browser, the AWS object does not have a AppSync property. Does anyone know how to use the AppSync SDK in the browser? Thanks
Hi guys, does anyone know if there can be a workaround for this aws-amplify/aws-sdk-ios#2208
We are using Cognito in production and is causing us bad reviews since after the refresh token is expired users experience a non working app and we have got no solution to handle it, has been already 16 days and not sure if a fix would come in or we need to move away from Cognito
queryStringParameters
in the API.get
method - I need to return a set of elements from my table given a specific param. I simply cannot get the thing to work. I have an API.put
method that's working, so both the API and the app are working correctly, but get
just doesn't work - even if I send an API.get
without params request, I still get a 404. I understand that this issue has been highly discussed, and supposedly a fix was implemented a while ago for this (since queryStringParameters
wasn't a working functionality a while ago). Honestly, anything would be helpful as I'm going crazy trying to figure this out ahah
Hello, I am stuck with the below error when using aws-amplify in my react app. Auth.signIn is returning the confirmed user from cognito pool. I also receive the verification code via SMS. However, when I try to call Auth.sendCustomChallengeAnswer I am getting below error. Note that Auth.signIn and Auth.sendCustomChallengeAnswer are in two different methods. Please advise.
code
`
handleSignIn = (a) => (param) => (e) => {
if (this.validator.fieldValid('First Name')
&& this.validator.fieldValid('Last Name')
&& this.validator.fieldValid('Phone Number')) {
let username = "+01" + this.state.phoneNumber.replace(/[^\d]/g, '');
Auth.signIn({
username, // Required, the username
}).then(user => {
console.log(user);
this.setState({
['formActivePanel' + a]: param,
['formActivePanel' + a + 'Changed']: true,
cognitoUser: user,
});
})
.catch(err => {
console.log(err);
//TODO Handle ERROR
});
} else {
this.validator.showMessageFor('First Name');
this.validator.showMessageFor('Last Name');
this.validator.showMessageFor('Phone Number');
}
}
handleVerify = () => {
if (this.validator.fieldValid('Verification code')) {
let challengeResponse = "123456";//this.state.otpCode;
let user = this.state.cognitoUser;
console.log("otpCode:" + challengeResponse);
console.log(this.state.cognitoUser);
Auth.sendCustomChallengeAnswer({
user,
challengeResponse,
}).then(user => {
console.log(user);
})
.catch(err => {
console.log(err);
//TODO Handle ERROR
});
} else {
this.validator.showMessageFor('Verification code');
}
}
`
ERROR [ERROR] 57:50.242 AuthError - Challenge response cannot be empty
Now I get below error.. the same thing just that instead of the challenge it is complaining about confirmation code. Console log clearly shows that it is receiving not-null confirmation code
AuthError - Confirmation code cannot be empty
console.<computed> @ index.js:1
ConsoleLogger._log @ ConsoleLogger.ts:91
ConsoleLogger.error @ ConsoleLogger.ts:142
AuthError @ Errors.ts:34
AuthClass.rejectAuthError @ Auth.ts:1976
AuthClass.confirmSignIn @ Auth.ts:889
Header.handleVerify @ Header.js:115
Got past that error... It was related to parsing and how I was sending parameters to sendCustomChallengeAnswer.
ErrorAuth.sendCustomChallengeAnswer({ user, challengeResponse, })
Fix -- I had to set otp to String(user inputed value) otherwise I get serialization errorAuth.sendCustomChallengeAnswer(user, otp)