$this->Auth->login unfortunately doesn't use "email" as one of it's
fields
in logging in. it instead uses "username" and "password" as its
default fields.
You can see it at the implementation of the login function of Auth.
http://api.cakephp.org/1.2/auth_8php-source.html#l00568
it uses $this->i
I am also having this problem. I can't make it login.
Tried several versions, with both passwords (hashed, no hashed), but
nothing.
Currently i have this:
$this->Auth->login(array('User'=>array('email'=>$this->data['User']
['email'], 'password'=>$this->data['User']['password2'])))
but it is not
Hello Fran,
I got it now working. Thanks for the big help!
Actually, $this->Auth->login($this->data); // login user
is already correct. I just missed to call the line to
redirect the user to the designated page.
Now it looks like this:
if ($this->User->save($this->data)) {
$login = $t
El 24/09/2008, a las 9:31, mario escribió:
> So in this case,
> $this->Auth->login($this->data); // login user
I think you have the plain version of the password in password2 field.
You could do some like:
if ($this->User->save($this->data)) {
$this->data['User']['password'] = $this
Yup. I see the point.
So in this case,
$this->Auth->login($this->data); // login user
I'm trying to pass the data from my form to be used for login.
As what I know, cakephp automatically hashes the password field of the
model 'user'.
So using $this->data in $this->Auth->login() might have some p
El 24/09/2008, a las 9:02, mario escribió:
> This time, it failed to login the user. It seems like there is some
> problem in terms of hashing my password.
Not sure, but you may try to login the User, with the non-hashed
password.
--
Fran Iglesias
[EMAIL PROTECTED]
--~--~-~--~--
That would be one option.
Here is my signup code:
function signup()
{
if (!empty($this->data)) {
if(isset($this->data['User']['password2']))
{
$password2hashed = $this->Auth->password($this-
>
El 24/09/2008, a las 7:28, mario escribió:
> Do anyone of you have an idea on how to automatically login
> after signing-up using Auth Component?
This seems a task for $this->Auth->login()
http://api.cakephp.org/1.2/class_auth_component.html#5c2562e36d1fb6f8b93a15fb23604abc
--
Fran Iglesias
Thanks Amit. I have tried your suggestion.
I used:
$this->Auth->Session->write($this->Auth->sessionKey . '.id', $this-
>User->getLastInsertID());
but it just became worse.
$this->Auth->user('id') doesn't return anything if I do that.
On Sep 24, 1:39 pm, "Amit Badkas" <[EMAIL PROTECTED]> wrote:
2008/9/24 mario <[EMAIL PROTECTED]>
>
> Hello everyone,
>
> Do anyone of you have an idea on how to automatically login
> after signing-up using Auth Component?
>
> I have tried like:
>
> $this->User->create();
> if ($this->User->save($this->data))
> {
>$this->Auth->Session->write($this->A
Hello everyone,
Do anyone of you have an idea on how to automatically login
after signing-up using Auth Component?
I have tried like:
$this->User->create();
if ($this->User->save($this->data))
{
$this->Auth->Session->write($this->Auth->sessionKey, $this->User-
>getLastInsertID());
11 matches
Mail list logo