From 7aa1b13f86ebf092ea1260d7595b53288f5b7207 Mon Sep 17 00:00:00 2001 From: Ivan Borzenkov Date: Mon, 27 Jul 2015 21:38:55 +0300 Subject: [PATCH] add revoke token --- access.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/access.lua b/access.lua index 55c391d..1028e24 100644 --- a/access.lua +++ b/access.lua @@ -149,6 +149,7 @@ else if debug then ngx.log(ngx.ERR, "DEBUG: "..email.." not in "..domain) end + https.request("https://accounts.google.com/o/oauth2/revoke","token=" .. access_token) return ngx.exit(ngx.HTTP_UNAUTHORIZED) end end @@ -158,6 +159,7 @@ else if debug then ngx.log(ngx.ERR, "DEBUG: "..email.." not in whitelist") end + https.request("https://accounts.google.com/o/oauth2/revoke","token=" .. access_token) return ngx.exit(ngx.HTTP_UNAUTHORIZED) end end @@ -167,6 +169,7 @@ else if debug then ngx.log(ngx.ERR, "DEBUG: "..email.." in blacklist") end + https.request("https://accounts.google.com/o/oauth2/revoke","token=" .. access_token) return ngx.exit(ngx.HTTP_UNAUTHORIZED) end end