Back

createEmailSession giving me a 400 bad gateway error

  • 0
  • Web
naveen
29 Mar, 2023, 15:40

My other api's like getting documents and adding are working fine, but this one gives 400 bad gateway error. Am i missing something? I have tried clearing browser cookies but no change

TL;DR
The user is experiencing a 400 bad gateway error when using the createEmailSession function. The error indicates that one of the entered data is invalid and the password field should have at least 8 characters. The solution is to try using a password with 8+ characters. Additionally, the user should check the network tab for the specific error message and screenshot it to provide more information. The user also mentions that their other APIs are working fine and they have tried clearing browser cookies to no avail.
Binyamin
29 Mar, 2023, 15:41

You code looks intact What are the details of the error you're getting? Also just to be sure you're trying to login or to create the user? Because if it's to create then you need to use the create method

naveen
29 Mar, 2023, 15:43

browser-ponyfill.js:518 POST http://localhost/v1/account/sessions/email 400 (Bad Request) (anonymous) @ browser-ponyfill.js:518 fetch @ browser-ponyfill.js:455 (anonymous) @ client.ts:408 (anonymous) @ tslib.es6.js:76 __awaiter @ tslib.es6.js:72 call @ client.ts:361 (anonymous) @ account.ts:524 (anonymous) @ tslib.es6.js:76 __awaiter @ tslib.es6.js:72 createEmailSession @ account.ts:503 createSession @ api.js:30 handleSubmit @ Login.jsx:30 callCallback @ react-dom.development.js:4157 invokeGuardedCallbackDev @ react-dom.development.js:4206 invokeGuardedCallback @ react-dom.development.js:4270 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4284 executeDispatch @ react-dom.development.js:9011 processDispatchQueueItemsInOrder @ react-dom.development.js:9043 processDispatchQueue @ react-dom.development.js:9056 dispatchEventsForPlugins @ react-dom.development.js:9067 (anonymous) @ react-dom.development.js:9258 batchedUpdates$1 @ react-dom.development.js:25979 batchedUpdates @ react-dom.development.js:3984 dispatchEventForPluginEventSystem @ react-dom.development.js:9257 dispatchEvent @ react-dom.development.js:6435 dispatchDiscreteEvent @ react-dom.development.js:6410

naveen
29 Mar, 2023, 15:44

Iam tring to login user

Binyamin
29 Mar, 2023, 15:44

Sorry, I meant in the network tab What are you getting from the server?

naveen
29 Mar, 2023, 15:46

Sorry iam new to development, This is the error message in google console. There is no other error as far as i know

Binyamin
29 Mar, 2023, 15:47

Like here if you have any

Binyamin
29 Mar, 2023, 15:47

Sure thing, Go to the network tab Then click on the request you are sending Then go to preview and take a screenshot

naveen
29 Mar, 2023, 15:48
Binyamin
29 Mar, 2023, 15:49

Good Now run the login request again and you will have it added to the list When it's added click on it Then click on preview Take screen shot of that

Binyamin
29 Mar, 2023, 15:49

Like this

naveen
29 Mar, 2023, 15:51
Binyamin
29 Mar, 2023, 15:51

OK So it doesn't return any data then Let me think for a minute

Binyamin
29 Mar, 2023, 15:52

OK, I got it

Binyamin
29 Mar, 2023, 15:52

I think

Binyamin
29 Mar, 2023, 15:53

Error 400 means that one of the data you've enter are invalid And it seems like the password field should be at least 8 characters So try with 8+ characters and let me know

naveen
29 Mar, 2023, 15:55

Oh completely forgot about it

naveen
29 Mar, 2023, 15:55

It worked

Binyamin
29 Mar, 2023, 15:55

Great

naveen
29 Mar, 2023, 15:56

Thank you for being paitent with me

Binyamin
29 Mar, 2023, 15:56

👍

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more