Comments (6)
Edit: The solution I mentionned didn't work, anyone else having trouble with this?
from eloquent-oauth.
Hey, it sounds like you have a non-nullable name
column in your users table right?
The solution is either to make the field nullable, or give it a value when you log the user in:
public function login()
{
try {
OAuth::login('facebook', function ($user, $details) {
$user->name = $details->firstName . ' ' . $details->lastName;
$user->save()
});
} catch(ApplicationRejectedException $e) {
// Add errors if users reject
} catch(InvalidAuthorizationCodeException $e) {
// Add errors if csrf
}
return Redirect::intended();
}
from eloquent-oauth.
I'm having an issue with the $user
This is my error when i'm using your code.
Creating default object from empty value
On line 20:
$user->name = $details->firstName . ' ' . $details->lastName;
It seems like the $user variable is unrecognised. Do we need to init a new user using new \User?
Thank you!
from eloquent-oauth.
Hmmm that's odd, I'm not sure what would be causing that. Is the project open source by any chance? Can you dd() $user in the closure and ensure it's null, and if so maybe try and trace down where it's coming from?
from eloquent-oauth.
What should user normally return? A new instance of a user object? or
model?
Thank you!
2015-03-12 2:32 GMT+01:00 Adam Wathan [email protected]:
Hmmm that's odd, I'm not sure what would be causing that. Is the project
open source by any chance? Can you dd() $user in the closure and ensure
it's null, and if so maybe try and trace down where it's coming from?β
Reply to this email directly or view it on GitHub
#40 (comment)
.
from eloquent-oauth.
It should be a new or existing instance of User depending on if the person has ever logged in before :/
from eloquent-oauth.
Related Issues (20)
- Not catching ApplicationRejectedException when user reject facebook login HOT 3
- Add provider - Stripe [Request]
- Seems to be incompatible with Laravel 5.1 HOT 1
- Support passing custom data into the `state` param
- Provider Request: Reddit (code provided) HOT 7
- Class 'OAuth' not found HOT 2
- Add documentation for "Designing your users table"
- Rename OAuth facade HOT 2
- Support for twitter? HOT 3
- Request FACEBOOK basic data (gender, user_friends) HOT 1
- Office365 HOT 1
- Adding a 'remember' parameter to login() method HOT 1
- Retrieving The Authenticated User HOT 2
- Merging Accounts HOT 2
- Log in by access token HOT 2
- Using Google Oauth behind proxy
- Authorize more than one provider for one user HOT 1
- Running something on register HOT 1
- ΒΏIs There a way to auth sending email and password to Facebook or google?
- 'No query results for model [App\User].' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquent-oauth.