Ho un accesso di Facebook che sto eseguendo con OAuth2, e quindi sto usando Laravel 4 integrato Sistema di autenticazione per riaccedere l'utente su Rivisitare. Per la maggior parte degli utenti, non vedo nessun problema con quello che ho, ma per un utente, che sta vedendo comparire il seguente errore login:L'argomento 1 passato a Illuminate Auth Guard :: login() deve implementare l'interfaccia Illuminate Auth UserInterface, null data aperta:
ErrorException
Argument 1 passed to Illuminate\Auth\Guard::login() must implement interface Illuminate\Auth\UserInterface, null given
open: */nfs/c09/h04/mnt/139243/domains/crowdsets.com/vendor/laravel/framework/src/Illuminate/Auth/Guard.php
* /**
* Log a user into the application.
*
* @param \Illuminate\Auth\UserInterface $user
* @param bool $remember
* @return void
*/
public function login(UserInterface $user, $remember = false)
{
$id = $user->getAuthIdentifier();
Ecco il codice di accesso/autenticazione rilevanti nel controller:
$check = Fan::where('fbid', '=', $user['uid'])->first();
if(is_null($check)) {
$fan = new Fan;
$fan->fbid = $user['uid'];
$fan->email = $user['email'];
$fan->first_name = $user['first_name'];
$fan->last_name = $user['last_name'];
$fan->gender = $user['gender'];
$fan->birthday = $user['birthday'];
$fan->age = $age;
$fan->city = $city;
$fan->state = $state_abbrev;
$fan->image = $user['image'];
$fan->friend_ids_url = $user['friends'];
$fan->friend_ids_unpacked = $friend_ids;
$fan->save();
$new = Fan::where('fbid', '=', $user['uid'])->first();
Auth::login($new);
return Redirect::to('fans/home');
}
else {
Auth::login($check);
$fan = Fan::find(Auth::user()->id);
$fan->image = $user['image'];
$fan->save();
return Redirect::to('fans/home');
var_dump($user);
}
questo è il mio codice nel modello per la tabella che sto usando per mantenere le informazioni utente, chiamato "Fans":
<?php
use Illuminate\Auth\UserInterface;
class Fan extends Eloquent implements UserInterface {
protected $guarded = array();
public static $rules = array();
public function getAuthIdentifier()
{
return $this->getKey();
}
public function getAuthPassword()
{
return $this->password;
}
questo è molto imbarazzante perché questo login funziona per tutto il altri profili che ho provato È solo con il profilo di questo amico che sta generando questo errore. Aggiungerò anche che al login (o ai tentativi) creerà più voci per questo utente nel database/tabella. Si suppone che questo sistema di autenticazione sia impostato per impedire esattamente questo. C'è qualcosa che mi manca?
L'hai preso risolto? se si, per favore condividi i tuoi pensieri? –