Search code examples
phplithium

Auth in li3 framework check(~ always authenticating


I've pretty much straight lifted my code from http://li3.me/docs/manual/auth/simple-authentication.md

in

if($user = Auth::check('customer', $this->request)) {
 //whatever
}

I'm trying to get a simple Auth::check in Lithium to fail when no user has logged in. Instead it seems to always perform a User::first() and return the first record in my Mysql users table where i would expect boolean FALSE.

pastium

help appreciated,

Paul


Solution

  • Use Auth::check($name, $request) when you actually have something in the $request otherwise just use Auth::check($name).

    I've written another adapter instead of Form called SaltedForm because I'm not using a simple password hashing (see pastium)