Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rlewkowicz
Copy link

Following the original documentation results in the sub field receiving a null and then complaining about not being nullable.

@joshcanhelp
Copy link
Contributor

@rlewkowicz - Appreciate the PR here! Can you explain a little more what's happening here and why this is necessary? I'm wondering if this is maybe happening in a newer version of Laravel as I have not come across this issue.

Also, if this is required, we need to add a few more fields based on the scopes that we're using (which control what we get back as the user identity). The default scopes will populate the following fields, in addition to the ones you added:

  • nickname
  • email_verified
  • picture
  • updated_at

@rlewkowicz
Copy link
Author

rlewkowicz commented Mar 13, 2020

@joshcanhelp

I was running into an issue where it just wouldn't add the sub id to the database. So I'd login with a user, and it would throw an error that the field was not nullable. If you add a default value it would work once and then fail consecutive since we made it unique.

Now it's been a few years since I've built an app, but I thought that there was a specific mass fillable exception, but it seemed to be failing silently.

I actually took this https://auth0.com/blog/build-a-laravel-6-app-with-authentication/ and added in the custom user handling.

Making the field fillable fixed my issues

@evansims
Copy link
Contributor

Hey Ryan 👋 Thank you for your PR! This appears to have been rolled into a separate commit at some point and is now live in the docs, so I'll be closing this. Take care!

@evansims evansims closed this Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants