Skip to content

Commit fa72eb5

Browse files
committed
show more helpful message on logout than browser default 403 message
1 parent 0762131 commit fa72eb5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

app/controllers/Login.scala

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ class Login(
99
) extends LoginController(deps, panDomainSettings) {
1010
private val defaultAllowHeaders = List("X-Requested-With","Origin","Accept","Content-Type")
1111

12+
override def showUnauthedMessage(message: String)(implicit request: RequestHeader): Result = {
13+
if (message == "logged out") Ok(views.html.loggedout())
14+
else super.showUnauthedMessage(message)
15+
}
16+
1217
def oauthCallback = Action.async { implicit request =>
1318
processOAuthCallback()
1419
}

app/views/loggedout.scala.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title>Logged out</title>
6+
</head>
7+
<body>
8+
<p>
9+
You have successfully logged out of Guardian tools. If you are still logged
10+
into Google, you will automatically log back in when you next visit.
11+
</p>
12+
13+
<p>
14+
This is usually what you would want to happen, but in the unlikely case
15+
that you do <em>not</em> want to be logged back in, for example if you need
16+
to switch accounts, you should go to Google (or Gmail, etc.), log out there
17+
and sign into a different account before returning to a Guardian tool.
18+
</p>
19+
20+
<p>
21+
For more support, please contact
22+
<a href="mailto:central.production@@guardian.co.uk">Central Production</a>.
23+
</p>
24+
</body>

0 commit comments

Comments
 (0)