Solved

cannot login with a registered account

bilaldemirer
Shopify Partner
4 1 1

Hey all,

I have a mobile app and I am using Storefront API.

I have an account on my shopify store and when I try to login I get this error : 

 [{"code": "UNIDENTIFIED_CUSTOMER", "field": null, "message": "Unidentified customer"}]

When I try to register with this account I get this error:

 [{"code": "TAKEN", "field": ["input", "email"], "message": "Email has already been taken"}]

Any idea how to fix this or why this is happening?

Accepted Solution (1)

bilaldemirer
Shopify Partner
4 1 1

This is an accepted solution.

The API returns same error:  [{"code": "UNIDENTIFIED_CUSTOMER", "field": null, "message": "Unidentified customer"}]

for both situations which are wrong password or not registered user. 
When I reset my password I am able login.

View solution in original post

Replies 3 (3)

bilaldemirer
Shopify Partner
4 1 1

This is an accepted solution.

The API returns same error:  [{"code": "UNIDENTIFIED_CUSTOMER", "field": null, "message": "Unidentified customer"}]

for both situations which are wrong password or not registered user. 
When I reset my password I am able login.

IhorVyshniakov
Shopify Partner
4 0 0

I tried to change my password, but error is still the same.

I logged in into store with my email(test@gmail.com) & have created customer in my store with the same email(test@gmail.com).

I need to get customer information via GraphQL, but it requires customerAccessToken.

IhorVyshniakov_3-1712658763390.png

 

So, I have to generate my customerAccessToken via mutation customerAccessTokenCreate.
While I'm trying to get access token with mutation customerAccessTokenCreate providing my email+password, I got this error

IhorVyshniakov_1-1712658673721.png

 

Please, help to solve this

 

lramhudda
Shopify Partner
10 1 4
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://shop.myshopify.com/api/2022-01/graphql.json',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{"query":"mutation SignInWithEmailAndPassword(\\n
$email: String!, \\n $password: String!,\\n) {\\n
customerAccessTokenCreate(input: { \\n email: $email, \\n password:
$password,\\n }) {\\n customerAccessToken {\\n accessToken\\n expiresAt\\n }
\\n customerUserErrors {\\n code\\n message\\n }\\n }\\
n}","variables":{"email":"'.$email.'","password":"'.$password.'"}}',
CURLOPT_HTTPHEADER => array(
'X-Shopify-Storefront-Access-Token: bvfgrt002fed8bece9ba6588e0a784',
'Content-Type: application/json',
'Cookie: cart_sig=ea4ee2a83f3712d2f1c6614d1cad5c89; secure_customer_sig='
),
));

return $get_response = curl_exec($curl);
curl_close($curl);