DevelopedByED - The Full Stack React Course 2023

DevelopedByED - The Full Stack React Course 2023

Register & Get access to index

4EvaLrnr

New member
TutFlixer
Nov 10, 2023
4
1
3
United States of America
Maybe someone could help with an issue I'm having during the course. Setting up the db/auth. When I sign up using the create account with email/name/pw my role gets saved as "user" as the default like I have it set up for the db. But when I signup using Google Oauth or Github, the role is null. Has anyone else ran into the issue? I followed along and the oauth sets it to the default "user" for Ed.
 

Dexer2015

Member
TutFlixer
Sep 27, 2020
92
128
21
In the middle of NoWhere
Maybe someone could help with an issue I'm having during the course. Setting up the db/auth. When I sign up using the create account with email/name/pw my role gets saved as "user" as the default like I have it set up for the db. But when I signup using Google Oauth or Github, the role is null. Has anyone else ran into the issue? I followed along and the oauth sets it to the default "user" for Ed.
This is strange it should always set it to default unless you send a value to the database.... please check the github of Ed to make sure it's the same code.

Please, Log in or Register to view URLs content!
 
  • Like
Reactions: 4EvaLrnr

4EvaLrnr

New member
TutFlixer
Nov 10, 2023
4
1
3
United States of America
@Dexer2015 thanks
Just saw what it was after spending like 2 days looking at the wrong parts comparing my code to his. The comment about the "default value to db" sorta set off a lightbulb for me.
This is what I had
JavaScript:
You don't have permission to view the code content. Log in or register now.
when I added the "s" at the end of role:RoleEnum like below. Everything started working as it should and oauth users now have "user" as a role.
JavaScript:
You don't have permission to view the code content. Log in or register now.

What was throwing me off was that regular signups got the user role so that led me to looking at auth adapter and stuff lmao.
 
  • Love it
Reactions: Dexer2015

Latest resources