added dynamic page to dashboard

This commit is contained in:
Ritikesh yadav
2024-04-10 17:36:00 +05:30
parent 6234274da8
commit 321573d2f3
2 changed files with 3 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ class AdminLoginController extends Controller
'last_login' => now()
]);
// $redirectPage = Iam_App_Resource_Action_Link::where('user_xid',$user->id)->first();
return response()->json(['status' => 200, 'message' => 'Welcome!']);
return response()->json(['status' => 200, 'message' => 'Welcome!','return_to_page'=>$user->role == 1 ? route('dashboard'):route('welcome-to-dashboard')]);
}
return response()->json(['status' => 401, 'message' => 'OTP has expired!']);
} else {

View File

@@ -200,7 +200,8 @@
// window.location.href='/dashboard';
setTimeout(() => {
// location.reload();
window.location.href = "{{route('welcome-to-dashboard')}}";
// window.location.href = "{{route('welcome-to-dashboard')}}";
window.location.href = result.return_to_page;
}, 1000);
}
if (result.status == 400) {