Skip to content

Commit

Permalink
Add 404 redirect in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony (Juntao) Hu committed Dec 5, 2021
1 parent 378cacb commit 83f2e47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/com/amigo/control/DashboardController.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ public class DashboardController {

@GetMapping("/dashboard")
public ModelAndView showDashboard(@ModelAttribute User user) {
if (!user.isValid() && !presenter.hasUser()) {
return new ModelAndView("404");
}
if (user != null) {
presenter.setUser(user);
}
ModelAndView mav = new ModelAndView("dashboard");
presenter.setUser(user);
presenter.populate(mav.getModel());
return mav;
}
Expand Down

0 comments on commit 83f2e47

Please sign in to comment.