#✅ - Error signing up: InvalidParameterException: Attributes did not conform to the schema: name.g...

1 messages · Page 1 of 1 (latest)

pallid basin
#

I'm getting an error while trying to create a simple sign up page. I'm not sure if this caused by amplify auth.

this is what my sign up code looks like. I can login with a test user I created manually but I cannot sign up and I've spent hours trying to figure this out. I appreciate any help!

paper marsh
#

👋 for the attribute block you can pass the attribute names themselves

attributes: {
          email,
          'name.givenName': givenName,  // Corrected attribute name
          'name.familyName': familyName,  // Corrected attribute name
        },
attributes: {
          email,
          givenName,  // Corrected attribute name
          familyName,  // Corrected attribute name
        },
pallid basin
#

Hi Josef, thank you. I'm still getting the same error after adjusting the attributes
Error signing up: InvalidParameterException: Attributes did not conform to the schema: name.givenName: The attribute name.givenName is required, name.familyName: The attribute name.familyName is required

#

const handleSignUp = async (e: React.FormEvent) => {
e.preventDefault();
try {
const { user } = await signUp({
username: email,
password,
attributes: {
email,
givenName, // Corrected attribute name
familyName, // Corrected attribute name
},
});
setIsSuccess(true);
// Optionally redirect or show a success message
} catch (err) {
setError('Failed to sign up. Please try again.');
console.error('Error signing up:', err);
}
};

#

XHRPOST
https://cognito-idp.us-east-1.amazonaws.com/
[HTTP/2 400 285ms]

POST
https://cognito-idp.us-east-1.amazonaws.com/
Status
400
VersionHTTP/2
Transferred750 B (209 B size)
Referrer Policystrict-origin-when-cross-origin
Request PriorityHighest
DNS ResolutionSystem

access-control-allow-origin
    *
access-control-expose-headers
    x-amzn-RequestId,x-amzn-ErrorType,x-amzn-ErrorMessage,Date
content-length
    209
content-type
    application/x-amz-json-1.1
date
    Thu, 03 Oct 2024 16:34:13 GMT
x-amzn-errormessage
    Attributes did not conform to the schema: name.givenName: The attribute name.givenName is required, name.familyName: The attribute name.familyName is required
x-amzn-errortype
    InvalidParameterException:
x-amzn-requestid
    63c0bdef-9011-4583-b00e-340002e40bfe
X-Firefox-Spdy
    h2
    
Accept
    */*
Accept-Encoding
    gzip, deflate, br, zstd
Accept-Language
    en-US,en;q=0.5
cache-control
    no-store
Connection
    keep-alive
Content-Length
    97
content-type
    application/x-amz-json-1.1
Host
    cognito-idp.us-east-1.amazonaws.com
Origin
    http://localhost:3000
Pragma
    no-cache
Priority
    u=0
Referer
    http://localhost:3000/
Sec-Fetch-Dest
    empty
Sec-Fetch-Mode
    cors
Sec-Fetch-Site
    cross-site
TE
    trailers
User-Agent
    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
x-amz-target
    AWSCognitoIdentityProviderService.SignUp
x-amz-user-agent
    aws-amplify/6.6.3 auth/1 framework/2
pallid basin
#

I resolved the issue. This is very silly! For anyone else if you run it this issue. I set these fields as Required attributes which is why this was causing an issue. I created a new user pool and only set "email" as the required field. Now the family_name and given_name are coming without any issues.

hasty zenith
#

Great to hear that you're unblocked, @pallid basin. And welcome to the Amplify server!

dusk grailBOT
#

✅ - Error signing up: InvalidParameterException: Attributes did not conform to the schema: name.g...

dusk grailBOT