Coder Social home page Coder Social logo

Can't login anymore about confide HOT 7 CLOSED

zizaco avatar zizaco commented on August 23, 2024
Can't login anymore

from confide.

Comments (7)

andrew13 avatar andrew13 commented on August 23, 2024

I don't see username on ln: 108 in https://github.com/Zizaco/confide/blob/master/src/Zizaco/Confide/Confide.php

If you pass in email and username to the input ala line 82-87:
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/master/app/controllers/user/UserController.php

Then login should work. Alternatively, where you use logAttempt, you can pass in just email or just username.

Confide::logAttempt( $input, true, array('email') )

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Can you post the post that your using to login via confide? (preferably with the full controller action)

from confide.

Edwin-Luijten avatar Edwin-Luijten commented on August 23, 2024

line 108 was a mistak D=, anyhow here's my login action

    /**
     * Attempt to do login
     *
     */
    public function do_login()
    {
        $input = array(
            'email'    => Input::get('email'),
            'username' => Input::get('username'),
            'password' => Input::get('password'),
            'remember' => Input::get('remember'),
        );

        if ( Confide::logAttempt( $input) )
        {
            $r = Session::get('loginRedirect');
            if (!empty($r))
            {
                Session::forget('loginRedirect');

                return Redirect::to($r);
            }

            // If credentials are correct, redirect to internal 
            $destiny = '/backend';

            // Redirect
            return Redirect::to( $destiny );
        }
        else
        {
            // Check if there was too many login attempts
            if( Confide::isThrottled( $input ) )
            {
                $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');
            }
            else
            {
                $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');
            }

            return Redirect::to('backend/user/login')
                ->withInput(Input::except('password'))
                ->with( 'error', $err_msg );
        }
    }

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

Set it like:

$input = array(
            'email'    => Input::get('email'),
            'username' => Input::get('email'),
            'password' => Input::get('password'),
            'remember' => Input::get('remember'),
        );

There's no username field, so setting email to both will make it work.

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

See the generator for an example: https://github.com/Zizaco/confide/blob/master/src/views/generators/controller.blade.php

from confide.

Zizaco avatar Zizaco commented on August 23, 2024

Thanks @andrew13

from confide.

andrew13 avatar andrew13 commented on August 23, 2024

No problem

from confide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.