Onur
Onur

Reputation: 451

Authentication from admin panel in Laravel 4

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?

Upvotes: 0

Views: 898

Answers (2)

The Alpha
The Alpha

Reputation: 146191

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.

Upvotes: 1

hopsoo
hopsoo

Reputation: 305

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

Upvotes: 2

Related Questions