PrimeAcademy / biscayne-syllabus

1 stars 4 forks source link

Register Button not Logging me in. #22

Closed Zeyini closed 2 weeks ago

Zeyini commented 2 weeks ago

Description

Your Real Name Zeyini

What do you want to happen? I want a registered user to be logging in when they click the register button. What is actually happening? When I click the register button it is making a post to the database. It also does also call the log in saga function and transfer the payload to the login in saga. It doesn't not route the user to view the protected routes for a logged in user.

Screenshots / Code Snippets

![image](https://github.com/PrimeAcademy/bisca Image 6-18-24 at 10 40 AM yne-syllabus/assets/147965678/7082dddc-2379-4fc7-9a96-a55dc18c576b)

login.saga.js:18 POST http://localhost:5173/api/user/login 400 (Bad Request)

What did you try? Who did you ask?

I followed the code from where the dispatch to registered occurs and looked at the register saga and the log in saga. I did also look at the server side code to see what the response is after registration. I did not see why user is not routed to log in.

I think the issues is with how saga is receiving the registered user data.

What branch is your code on? Did you git push?

I am o feature/registerfrom branch.

👍

When was the last time you took a break?

I took a break by going to sleep last night . 😃

matthew-black commented 2 weeks ago

@Zeyini What does your login saga function expect to receive as a payload? Right now, your code is sending the entire registerReducer:

Screenshot 2024-06-18 at 10 49 57 AM

Please shoot me a DM on Slack after investigating this. 🙂

matthew-black commented 2 weeks ago

🎉