I have a redirect problem from the game! the form. I think the problem is how I handle the routes. The idea is that the user should be able to go to dashboard.html either by first starting through index.hmtl, using login from using the secruity key, or by entering directly into a valid path containing access_token (using qr code redirection)
I am trying to do the following:
1) using the form on index.html (route: Application.index)
Here is my form (found in index.html):
<form action="@{Dashboard.authenticate()}" method="POST" name="login">
<input name="key" type="password" maxlength="128" value="${flash.key}">
<input class="button" id="btnLogin" type="submit" value="Login">
</form>
2) authenticate and redirect to dashboard.html (route: Dashboard.dashboard)
public static void dashboard(String access_token) {
render(username);
}
public static void authenticate(String key) {
dashboard(access_token);
}
Here is my route file:
GET / Application.index
POST /dashboard Dashboard.authenticate
GET /dashboard Dashboard.dashboard
, (String access_token) URL-, : http://localhost:9000/dashboard?access_token=0000
, , (String key), URL http://localhost:9000/dashboard?access_token&key=1234, - var auth(). , , , 100% , .
Play 1.2.4
.