Make sure your default guard is web (in auth.php)
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
I was implementing API with Dingo and it was working great. Now I need to add some functionality (for user registration) that wont go trough API but normal web page. And I cant seem to find how to disable Dingo exception conversion to JSON unless I comment out dingo service provider from conf/app.php and all $api routes.
Can I live in both worlds? :)
My package routes file
Route::group(['prefix' => 'auth', 'namespace' => '\Users\Http\Controllers\Auth'], function(){
Route::get('register', 'AuthController@getRegister');
Route::post('register', 'AuthController@postRegister');
});
//
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->group(['prefix' => 'oauth', 'as' => 'oauth', 'namespace' => '\Users\Http\Controllers'],
function ($api) {
$api->get('/', 'OauthController@index');
$api->post('/access_token', ['as' => ':access_token', 'uses' => 'OauthController@token'] );
});
});
Step by step debugging always works :D Found it!
I set API_DOMAIN config to same domain I was using for normal web. I had to unset domain and set API_PREFIX instead. It seems to be working now.
Thanks @lars64 for your help and time invested!
Please or to participate in this conversation.