ログインの問題の修正
このコミットが含まれているのは:
コミット
a9046ff597
|
@ -14,7 +14,7 @@ class AdminController extends Controller {
|
|||
|
||||
/* Traitで使うメソッド */
|
||||
protected function getGuard () {
|
||||
return 'admin';
|
||||
return 'admins';
|
||||
}
|
||||
protected function getModel () {
|
||||
return new \App\Models\Admin();
|
||||
|
|
|
@ -52,7 +52,7 @@ trait AuthenticationTrait {
|
|||
|
||||
// セッションを想像する
|
||||
$guard = $this->getGuard();
|
||||
if ($r->session()->has($guard)) {
|
||||
if (!$r->session()->has($guard)) {
|
||||
// 認証されたデータのpassword以外を把握する
|
||||
$login_user_datum = $get->toArray();
|
||||
unset($login_user_datum['password']);
|
||||
|
|
|
@ -22,7 +22,7 @@ class ChildrenController extends Controller {
|
|||
|
||||
/* Traitで使うメソッド */
|
||||
protected function getGuard () {
|
||||
return 'child';
|
||||
return 'children';
|
||||
}
|
||||
protected function getModel () {
|
||||
return new \App\Models\Child();
|
||||
|
|
|
@ -22,7 +22,7 @@ class FathersController extends Controller {
|
|||
|
||||
/* Traitで使うメソッド */
|
||||
protected function getGuard () {
|
||||
return 'father';
|
||||
return 'fathers';
|
||||
}
|
||||
protected function getModel () {
|
||||
return new \App\Models\Father();
|
||||
|
|
|
@ -20,6 +20,10 @@ class Authenticate extends Middleware
|
|||
}
|
||||
|
||||
public function handle ($request, Closure $next, ...$guard) {
|
||||
if (!$request->session()->has($guard)) {
|
||||
return redirect(route($guard[0].'login'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Route;
|
|||
|
||||
Route::group(['prefix' => 'admin'], function () {
|
||||
// AdminController
|
||||
Route::post('/login', '\App\Http\Controllers\Api\AdminController@login')->name('adminlogin');
|
||||
Route::post('/login', '\App\Http\Controllers\Api\AdminController@login')->name('adminslogin');
|
||||
|
||||
Route::group(['middleware' => 'auth:admins'], function () {
|
||||
// AdminController
|
||||
|
@ -73,9 +73,9 @@ Route::post('/contacts/register', '\App\Http\Controllers\Api\ContactsController@
|
|||
|
||||
Route::group(['prefix' => 'fathers'], function () {
|
||||
// FathersController
|
||||
Route::post('/registerMain', '\App\Http\Controllers\Api\FathersController@registerMain')->name('fatherregistermain');
|
||||
Route::post('/requestPassword', '\App\Http\Controllers\Api\FathersController@requestPassword')->name('fatherrequestpassword');
|
||||
Route::post('/login', '\App\Http\Controllers\Api\FathersController@login')->name('fatherlogin');
|
||||
Route::post('/registerMain', '\App\Http\Controllers\Api\FathersController@registerMain')->name('fathersregistermain');
|
||||
Route::post('/requestPassword', '\App\Http\Controllers\Api\FathersController@requestPassword')->name('fathersrequestpassword');
|
||||
Route::post('/login', '\App\Http\Controllers\Api\FathersController@login')->name('fatherslogin');
|
||||
|
||||
Route::group(['middleware' => 'auth:fathers'], function () {
|
||||
Route::put('/updateImage/{father_id}', '\App\Http\Controllers\Api\FathersController@updateImage');
|
||||
|
|
|
@ -59,7 +59,7 @@ Route::get('/unknown-error ', function () { return vie
|
|||
// ---------------------------------------- Child Account ------------------------------------------- //
|
||||
Route::group(['prefix' => 'c-account'], function () {
|
||||
Route::get('/register-temporary', function () { return view('c_account.auth'); });
|
||||
Route::get('/login', function () { return view('c_account.auth'); });
|
||||
Route::get('/login', function () { return view('c_account.auth'); })->name('childrenlogin');
|
||||
Route::group(['prefix' => 'register'], function () {
|
||||
Route::get('/', function () { return view('c_account.auth'); });
|
||||
Route::get('/complete', function () { return view('c_account.auth'); });
|
||||
|
@ -71,29 +71,31 @@ Route::group(['prefix' => 'c-account'], function () {
|
|||
Route::get('/complete', function () { return view('c_account.auth'); });
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'meeting'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{id}', function () { return view('c_account.index'); });
|
||||
});
|
||||
Route::get('/search', function () { return view('c_account.index'); });
|
||||
Route::group(['prefix' => 'parent'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{father_id}', function () { return view('c_account.index'); });
|
||||
});
|
||||
Route::group(['middleware' => 'auth:children'], function () {
|
||||
Route::group(['prefix' => 'meeting'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{id}', function () { return view('c_account.index'); });
|
||||
});
|
||||
Route::get('/search', function () { return view('c_account.index'); });
|
||||
Route::group(['prefix' => 'parent'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{father_id}', function () { return view('c_account.index'); });
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'profile'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/edit/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/password-edit/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/withdrawal', function () { return view('c_account.index'); });
|
||||
Route::group(['prefix' => 'profile'], function () {
|
||||
Route::get('/', function () { return view('c_account.index'); });
|
||||
Route::get('/detail/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/edit/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/password-edit/{child_id}', function () { return view('c_account.index'); });
|
||||
Route::get('/withdrawal', function () { return view('c_account.index'); });
|
||||
});
|
||||
Route::get('/withdrawal/complete', function () { return view('c_account.withdrawal.complete'); });
|
||||
});
|
||||
Route::get('/withdrawal/complete', function () { return view('c_account.withdrawal.complete'); });
|
||||
});
|
||||
|
||||
// ---------------------------------------- Admin Account ------------------------------------------- //
|
||||
Route::group(['prefix' => 'admin'], function () {
|
||||
Route::get('/login', '\App\Http\Controllers\Api\AdminController@checkLogin')->name('adminlogin');
|
||||
Route::get('/login', '\App\Http\Controllers\Api\AdminController@checkLogin')->name('adminslogin');
|
||||
Route::get('/logout', '\App\Http\Controllers\Api\AdminController@logout');
|
||||
|
||||
Route::group(['middleware' => 'auth:admins'], function () {
|
||||
|
|
新しいイシューから参照