Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

Hi, just messing with some facebook auth and noticed that on the request before i Redirect::to( '/' ), the URL has "#=" on the end and now when I use any Redirect, it keeps the hash on the end and is driving me nuts. Anyone know how to ignore the hash?

regards

Last updated 3 years ago.
0

Can you show your redirection code.

Last updated 3 years ago.
0

I already have :-)

Redirect::to( '/' );
	public function login() {

		$code = Input::get( 'code' );
	    $fb = OAuth::consumer( 'Facebook' );
	    if ( ! empty( $code ) ) {
	    	try {
	        	$token = $fb->requestAccessToken( $code );
	        	$user = $this->user();
	        	$email = $user['email'];
	        	$userModel = User::firstOrNew( array( 'email' => $email ) );
        		$userModel->email = $email;
        		$userModel->first_name = $user['first_name'];
        		$userModel->last_name = $user['last_name'];
        		$userModel->username = username( $user['first_name'] . ' ' . $user['last_name'] );
        		$userModel->password = Hash::make( $user['id'] );
        		$userModel->save();
	        	Session::set( 'authentication', 'facebook' );
	        	Auth::loginUsingId( $userModel->id );
	        	return Redirect::home();
	       	}
	       	catch( Exception $e ) {
	       		return Redirect::to( '/facebook-login' );
	       	}
	    } else {
	        $url = $fb->getAuthorizationUri();
	        return Redirect::to( (string) $url );
	    }

	}

#edit just removed that redirect and added in the home named redirect route to see if that worked but sadly not.

Last updated 3 years ago.
0

anyone???

Last updated 3 years ago.
0

cmon someone must have come across this before?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.