I facing the issue with auth0.
When i read auht0 quickstart guide it says, In app/AppServiceProvider you have to paste this code.
I have done this then auth0 wants me to create a “CustomUserRpositry” in the repositories folder.
where you have 3 functions, and then you have to make changes in “app/provoders/AppserviceProvider” paste this code.
I am very confused which one is to keep?
And also when i place the CustomUserRepository, It is giving me an error of “Undefined index user_id”.
And one more thing when i download the sample the code is different?
Guide me i am a little stuck.
Can you share the link to the quickstart you are using? Thank you!
What happens when you try to login and download the sample with filled in values from your tenant settings and run it?
When using “CustomUserRepository” and change in the function of “upsertUser”,
return $re = User::firstOrCreate([‘sub =>email’ => $profile[‘sub =>email’]], [
‘email’ => $profile[‘email’] ?? ‘’,
‘name’ => $profile[‘name’] ?? ‘’
ERROR: Undefined index: user_id.
I had change the AppServiceProviders as said in the docs. But facing the above problem.
If you want the Screenshot i will give you.
Thanks for providing all that context. Let me try to implement the quickstart myself and get back to you with my findings soon!
I think i have found out the issue of what is happening. Let me tell you,
When i use “\Auth0\Login\Repository\Auth0UserRepository::class”, It gives me proper user detail not more but it gives me.
Now When i use “CustomUserRepository” and change the key of the function in “upsertUser” sub to email, In the vendor folder the file auth0User.php checks for the “sub” key as i have change sub to email it looks for user_id key, But in my users table there is no user_id column, That’s why this error is comming.
I have written as i looked into it. you can check.
Now I want to know my users table which is locally ofcourse is not having the column of sub and user_id. So apart from this i just want to use the ‘email’ column how can do that.
I don’t want to change manually in vendor folder every time of install/update.
If you have any solution for this plz let me know.
Thanks for passing that additional context
Plz read the last para and reply.
I’ll get back to you once I reproduce it myself using the quickstart. Will update you on that!
And one more i have found. In “CustomUserRepository” if you download with laravel 8 there is no “Models” folder is used.
It should be “use App\Models\User;”.