Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4578964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:34:32+00:00 2026-05-21T20:34:32+00:00

I know there are already articles that covered this, but I’m having an issue

  • 0

I know there are already articles that covered this, but I’m having an
issue that hasn’t been resolved, even after reading those articles.

Here it goes:

I have 2 controllers, a MainController with this method:

public static void login(String username, String password) throws Throwable
{ 
    Secure.authenticate(username, password, false); 
} 

And a SecurityController, an extension of Secure.Security with this
method:

//overrides Security.authenticate(...)
public static boolean authenticate(String username, String password) { 
    return UserDAO.checkUserLogin(username, password); 
}

Then we have a view that pops out a small login screen (similar to
that of twitter’s login).
That view calls @{MainController.login()} with the input fields named correctly

When the user clicks the login button, the login controlller should be
called, with this behaviour:
– Correct? Refer to the url the user came from
– Incorrect? Show standard login panel with error message

But that does not happen:

Play redirects to the login page in any case, and always without an error flash.
Simply the plain login screen, without any error messages.

(note that there should be indeed an error message, because the user
does not exist in the db)

When I do create a user first, the application reacts the same way.

The url of the page login(…) redirects to is: http://localhost:9000/loginremember=false&password=secret&username=Bob

My question is now:
Why does Play do this?
Why doesn’t it redirect to
the page it came from (with redirectToOriginalUrl())?
It shouldn’t be giving those parameters to the login method of Secure, it should
render at least the login screen with the error messages.

But even when I provide the details correctly, it still just redirects
to the login view of the Secure module, with all the paramters.

What am I doing wrong?

Thanks beforehand,
kind regards,
Jasper

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T20:34:32+00:00Added an answer on May 21, 2026 at 8:34 pm

    Fixed this issue with the implementation of a class that doesn’t extend the Controller class. Works fine.

    Thanks @Felipe Oliveira!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there is already a question about this but my issue is more
I know there have been a few threads on this before, but I have
I know there are tons of questions about this already floating around SO but
OK, I know there have already been questions about getting started with TDD ..
I know this is a similar question to one already asked, but I was
I know there are already a few questions regarding recommendations for C++ unit test
First, I know there are methods off of the generic List<> class already in
I know there is a registry key indicating the install directory, but I don't
I know there are a lot of positive things mod-rewrite accomplishes. But are there
I know there is a function somewhere that will accept a client rect and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.