You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/12/24 12:09:17 UTC

[2/2] incubator-ponymail git commit: redirect to front page of oauth got the wrong idea

redirect to front page of oauth got the wrong idea

Sometimes oauth.html will think it's supposed to redirect to itself,
so check for that and redir to front page instead if so.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/b873bb20
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/b873bb20
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/b873bb20

Branch: refs/heads/master
Commit: b873bb20610589d405f27047482ba93ee92339c2
Parents: 3e1f517
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Dec 24 13:08:50 2016 +0100
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Dec 24 13:08:50 2016 +0100

----------------------------------------------------------------------
 CHANGELOG.md     | 1 +
 site/js/oauth.js | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/b873bb20/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2bfbc27..43f8e4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -93,6 +93,7 @@
 - unhelpful error reporting for invalid Permalinks/Source links (#123)
 - import-mbox.py fails to unescape >From lines (#212)
 - Updated Google+ API for logins
+- Fixed a redirect bug with oauth
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/b873bb20/site/js/oauth.js
----------------------------------------------------------------------
diff --git a/site/js/oauth.js b/site/js/oauth.js
index b892ab2..57f5242 100644
--- a/site/js/oauth.js
+++ b/site/js/oauth.js
@@ -76,6 +76,10 @@ function parseOauthResponse(json) {
         window.sessionStorage.removeItem("ponymail_redirect_oauth")
     }
     if (json.okay) {
+        // if wloc tries to redirect to oauth.html, rewrite that to the front page instead
+        if (wloc.match(/oauth.html/)) {
+            wloc = "./"
+        }
         location.href = wloc
     } else {
         popup("Oauth failed", "Authentication failed: " + json.msg, null, 10, wloc)