Support the ongoing development of Laravel.io →
posted 8 years ago
Packages
Last updated 1 year ago.
0

Hello Devonab,

I'm facing the exact same problem.

Laravel v5.2 and lara-auth-bridge v2.1.0.

No errors in the Laravel log.

Did you figure this out?

Thank you!

0

Hello, unfortunately no... I've finally made my own forum (more simpler than phpbb but that make the job... )

0

Thank you Devonab for your prompt response.

It seems like we found the problem.

The problem is that ApiController::getSession is not able to validate the session.

The reason for this is that since Laravel 5.2, you need to wrap the routes in a web middleware to access the session state across the board (like the global in 5.1).

Simply change the routes declaration in laravel/vendor/callmenp/lara-auth-bridge/src/CallMeNP/LaraAuthBridgeServiceProvider.php from this:

Route::get('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@getSession'); 
Route::post('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@doLogin');
Route::delete('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@doLogout');

to this:

Route::group(['middleware' => ['web']], function () {
    Route::get('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@getSession');
    Route::post('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@doLogin');
    Route::delete('/auth-bridge/login', 'CallMeNP\LaraAuthBridge\Controllers\ApiController@doLogout');
}); 

This solved the problem for us.

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Devonab devonab Joined 10 Mar 2016

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.

© 2024 Laravel.io - All rights reserved.