Code Monkey home page Code Monkey logo

Comments (8)

adamwathan avatar adamwathan commented on June 1, 2024

Hey! Not sure what the problem could be... Could you check out this walkthrough video I put together, and see what might be different about your setup vs. what I put together?

https://vimeo.com/120085196

Are you on Laravel 4 or 5?

from eloquent-oauth.

vgomes avatar vgomes commented on June 1, 2024

I'm on laravel 5.

I've been checking my user model and it's like the default one that laravel ships.

My problem, is when I got redirected back, system performs a select in DB

select * from oauth_identities where provider = ? and provider_user_id = ? limit 1

and performs it with the data google returns, and then, tries to create the user, but with no data, because nothing is ever stored in oauth_identities

insert into users (updated_at, created_at) values (?, ?)

If I catch that exception and store that info, the systems works perfectly.
Run a composer update and problem is the same:

Installing adamwathan/eloquent-oauth (dev-laravel-5 daca55b)

from eloquent-oauth.

adamwathan avatar adamwathan commented on June 1, 2024

What database are you using? I'm guessing the issue is you need to make the email and password columns nullable on your users table, since creating a user through this package results in a user with no credentials (of course, since they are logging in through a separate service).

The entry to oauth_identities is created after creating the users entry, because the oauth_identities table has a foreign key to the user's ID.

The first select is performed to see if the user already exists, if they don't create a new user, then save an OAuthIdentity for that new user.

from eloquent-oauth.

vgomes avatar vgomes commented on June 1, 2024

I see, that's exactly my problem.
Thank you very much!

from eloquent-oauth.

adamwathan avatar adamwathan commented on June 1, 2024

No prob glad I could help! :)

from eloquent-oauth.

aborovkov avatar aborovkov commented on June 1, 2024

Hello! I have a problem with using both linkedin and facebook for one user... db insert fails.. is it possible to solve it somehow?

from eloquent-oauth.

adamwathan avatar adamwathan commented on June 1, 2024

You mean using LinkedIn and Facebook for the same person and trying to make it one account? That isn't supported at the moment, maybe in the future. See this issue: #19

from eloquent-oauth.

dipuchaudhary avatar dipuchaudhary commented on June 1, 2024
Illuminate \ Database \ QueryException (42S02)
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.oauth_identities' doesn't exist (SQL: select * from `oauth_identities` where `provider` = github and `provider_user_id` = 34309829 limit 1)
Previous exceptions
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.oauth_identities' doesn't exist (42S02)``

why i'm getting this error although i've made changes in the user table email and password as nullable.
Screenshot from 2020-05-18 17-17-04

from eloquent-oauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.