ripper234
ripper234

Reputation: 230206

How do I make the logout action redirect to a specific page in Play?

I am using a custom Security controller that extends Secure.Security.

Currently the "logout" action leaves me at the login page. How can I redirect it to another page? This doesn't work:

public class Security extends Secure.Security {
    static boolean authenticate(String username, String password) {
        User user = User.find("byUsername", username).first();
        return user != null;
    }

    public static void logout() {
        Application.index();
    }
}

Upvotes: 1

Views: 265

Answers (1)

ripper234
ripper234

Reputation: 230206

Never mind, I found the answer once I found where the sources for the Secure class are.

public static void onDisconnected() {
    Application.index();
}

Upvotes: 1

Related Questions