문제

What I want to do is authenticating user from admin panel. I am going to use this in order to manage a user's account from admin panel. I can not use laravel authenticate function because I have users hashed password. Is it possible to reverse hashed password? Otherwise, is it possible to authenticate user from username?

도움이 되었습니까?

해결책

Please take a look at this function http://laravel.com/docs/security#manually

다른 팁

It's possible in many ways:

Auth::loginUsingId(1); // using id 1

Or use this:

$user = User::find(1); // using id 1
Auth::login($user);

Or as you asked to log in using username, so you may try this:

$user = User::where('username', 'someUser')->first();
Auth::login($user);

If you know the id then you may use loginUsingId($id) method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top