2016-06-03 3 views
0

인증 문제가 있습니다. 버전 5.1에서는 로컬에서는 잘 작동하지만 서버에서는 이상한 오류가 발생합니다. check() 함수는 항상 false를 반환하지만 인증 컨트롤러에서 디버그를했습니다. attempt() 함수에서 true를 얻었지만 check()은 리디렉션 후에 false를 반환합니까?버전 5.1에 대한 Laravel 인증 문제

설정/auth.php :

return [ 

    'driver' => 'eloquent', 
    'model' => 'App\Company', 
    'table' => 'company', 
    'password' => [ 
     'email' => 'emails.password', 
     'table' => 'password_resets', 
     'expire' => 60, 
    ], 
]; 

회사 모델 클래스

<?php 

namespace Testnamespace; 

use Cviebrock\EloquentSluggable\SluggableInterface; 
use Cviebrock\EloquentSluggable\SluggableTrait; 
use Illuminate\Auth\Authenticatable; 
use Illuminate\Auth\Passwords\CanResetPassword; 
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; 
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; 
use Illuminate\Database\Eloquent\Model; 
use Illuminate\Database\Eloquent\SoftDeletes; 
use Illuminate\Support\Facades\Route; 
use Sofa\Eloquence\Eloquence; 

class Company extends Model implements AuthenticatableContract, CanResetPasswordContract, SluggableInterface 
{ 

    use Authenticatable, CanResetPassword, SoftDeletes, SluggableTrait, Eloquence; 

    public $timestamps = true; 
    protected $table = 'company'; 
    protected $dates = ['deleted_at']; 
    protected $fillable = [ 
     'email', 
     'password', 
     'name', 
     'info', 
     'extra_info', 
     'phone', 
     'mobile', 
     'street', 
     'postal_code', 
     'website', 
     'facebook', 
     'newsletter' 
    ]; 
    protected $sluggable = [ 
     'build_from' => 'name', 
     'save_to' => 'slug', 
    ]; 
    protected $searchableColumns = ['name']; 
    protected $primaryKey = 'id'; 


} 
어떤 도움이 appriciated됩니다

...

+0

오류 메시지가 무엇입니까? –

+0

오류 메시지가 없지만 auth :: check() 함수가 false를 반환합니다. –

+0

config/auth.php 및 config/session.php를 제외한 다른 구성이 필요합니까 ?? –

답변

0

당신이 다음 (아래 줄을 변경 하위 도메인을 사용하는 경우 config/session)

또한

'domain' => '.yourdomain.com', 

에 당신은 당신이 저장/프레임 워크/세션 디렉토리에 주어진 쓰기 권한이있는 경우 다음 확인 세션을

'driver' => env('SESSION_DRIVER', 'file'), 

를 저장하는 파일을 사용하는 경우. 데이터베이스 세션을 변경해보십시오.

+0

도메인을 설정하려고했지만 동일한 문제가 없습니다. –

+1

나는 도메인과 관련된 비슷한 문제에 직면 해 있습니다. 나는 실제 경로가 다르며 서버에서 코드 위치가 다른 서버 경로 및 심볼 링크와 관련된 문제가있을 수 있음을 발견했습니다. – fKnight

+0

어떻게 해결할 수 있습니까 ?? –