Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- return array(
- 'GET /auth/signin' => array( 'name' => 'signin', 'before' => 'noauth', 'do' => function() {
- return View::make( 'layouts/default' )->partial( 'content', 'auth/signin' );
- } ),
- 'POST /auth/signin' => array( 'before' => 'noauth, csrf', 'do' => function() {
- $username = Input::get( 'username' );
- $password = Input::get( 'password' );
- if( empty( $username ) || empty( $password ) ) {
- return Redirect::to_signin()->with( 'error', 'You must enter a username and password.' );
- }
- elseif( !Auth::login( $username, $password ) ) {
- return Redirect::to_signin()->with( 'error', 'Invalid username/password.' );
- }
- else {
- return Redirect::to_home();
- }
- } )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement