Skip to content

show more helpful message on logout than browser default 403 message #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/Login.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class Login(
) extends LoginController(deps, panDomainSettings) {
private val defaultAllowHeaders = List("X-Requested-With","Origin","Accept","Content-Type")

override def showUnauthedMessage(message: String)(implicit request: RequestHeader): Result = {
if (message == "logged out") Ok(views.html.loggedout())
else super.showUnauthedMessage(message)
}

def oauthCallback = Action.async { implicit request =>
processOAuthCallback()
}
Expand Down
24 changes: 24 additions & 0 deletions app/views/loggedout.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Logged out</title>
</head>
<body>
<p>
You have successfully logged out of Guardian tools. If you are still logged
into Google, you will automatically log back in when you next visit.
</p>

<p>
This is usually what you would want to happen, but in the unlikely case
that you do <em>not</em> want to be logged back in, for example if you need
to switch accounts, you should go to Google (or Gmail, etc.), log out there
and sign into a different account before returning to a Guardian tool.
</p>

<p>
For more support, please contact
<a href="mailto:central.production@@guardian.co.uk">Central Production</a>.
</p>
</body>