src/main/java/com/webcheckers/ui/PostLoginRoute.java
/**
    * WebCheckers post login route
    *
    * @param request
    *   the HTTP request
    * @param response
    *   the HTTP response
    *
    * @return
    *   the rendered HTML for PostLoginRoute
    */
WebCheckers post login route
@param request
the HTTP request
@param response
the HTTP response

@return
the rendered HTML for PostLoginRoute
WebCheckers post login route @param request the HTTP request @param response the HTTP response @return the rendered HTML for PostLoginRoute
@Override
    public Object handle(Request request, Response response) {
        final Session httpSession = request.session();
        Map<String, Object> vm = new HashMap<>();
        vm.put(VMAttributes.TITLE, TITLE);
        final String usernameStr = request.queryParams(USERNAME);
        final String passStr = request.queryParams(PASSWORD);
        LoginStatus logged = Application.playerLobby.sign_in(usernameStr, passStr);
        if (logged == LoginStatus.INVALID_USER_FORMAT){
            vm.put(VMAttributes.MESSAGE, NAME_ERR);
            return templateEngine.render(new ModelAndView(vm, "signin.ftl"));
        } else if (logged == LoginStatus.USER_ALREADY_LOGIN){
            vm.put(VMAttributes.MESSAGE, ALREADY);
            return templateEngine.render(new ModelAndView(vm, "signin.ftl"));
        } else if (logged == LoginStatus.INVALID_PASS_FORMAT){
            vm.put(VMAttributes.MESSAGE, PASS);
            return templateEngine.render(new ModelAndView(vm, "signin.ftl"));
        } else if (logged == LoginStatus.EXISTING_USER_LOGIN || logged == LoginStatus.NEW_USER_LOGIN){
            httpSession.attribute(SessionAttributes.PLAYER, Application.playerLobby.getPlayers().get(usernameStr));
            vm.put(VMAttributes.CURRENT_USER, Application.playerLobby.getPlayers().get(usernameStr));
            vm.put(VMAttributes.MESSAGE, WELCOME_MSG);
            vm.put(VMAttributes.SIGNED, Application.playerLobby.get_logged_names());
            vm.put(VMAttributes.PLAYING, Application.playerLobby.get_playing());
            vm.put(VMAttributes.SPECTATING, Application.playerLobby.get_spectating());
            return templateEngine.render(new ModelAndView(vm, "home.ftl"));
        } else {
            vm.put(VMAttributes.MESSAGE, WRONG);
            return templateEngine.render(new ModelAndView(vm, "signin.ftl"));
        }
    }
@ Override public Object handle ( Request request , Response response ) { final Session httpSession = request . session ( ) ; Map < String , Object > vm = new HashMap < > ( ) ; vm . put ( VMAttributes . TITLE , TITLE ) ; final String usernameStr = request . queryParams ( USERNAME ) ; final String passStr = request . queryParams ( PASSWORD ) ; LoginStatus logged = Application . playerLobby . sign_in ( usernameStr , passStr ) ; if ( logged == LoginStatus . INVALID_USER_FORMAT ) { vm . put ( VMAttributes . MESSAGE , NAME_ERR ) ; return templateEngine . render ( new ModelAndView ( vm , "signin.ftl" ) ) ; } else if ( logged == LoginStatus . USER_ALREADY_LOGIN ) { vm . put ( VMAttributes . MESSAGE , ALREADY ) ; return templateEngine . render ( new ModelAndView ( vm , "signin.ftl" ) ) ; } else if ( logged == LoginStatus . INVALID_PASS_FORMAT ) { vm . put ( VMAttributes . MESSAGE , PASS ) ; return templateEngine . render ( new ModelAndView ( vm , "signin.ftl" ) ) ; } else if ( logged == LoginStatus . EXISTING_USER_LOGIN || logged == LoginStatus . NEW_USER_LOGIN ) { httpSession . attribute ( SessionAttributes . PLAYER , Application . playerLobby . getPlayers ( ) . get ( usernameStr ) ) ; vm . put ( VMAttributes . CURRENT_USER , Application . playerLobby . getPlayers ( ) . get ( usernameStr ) ) ; vm . put ( VMAttributes . MESSAGE , WELCOME_MSG ) ; vm . put ( VMAttributes . SIGNED , Application . playerLobby . get_logged_names ( ) ) ; vm . put ( VMAttributes . PLAYING , Application . playerLobby . get_playing ( ) ) ; vm . put ( VMAttributes . SPECTATING , Application . playerLobby . get_spectating ( ) ) ; return templateEngine . render ( new ModelAndView ( vm , "home.ftl" ) ) ; } else { vm . put ( VMAttributes . MESSAGE , WRONG ) ; return templateEngine . render ( new ModelAndView ( vm , "signin.ftl" ) ) ; } }
WebCheckers post login route
 @param request
   the HTTP request
 @param response
   the HTTP response
WebCheckers post login route @param request the HTTP request @param response the HTTP response
//Following if statement checks for password / username validation and redirects //the use if necessary.