aboutsummaryrefslogtreecommitdiffhomepage
path: root/auth.js
diff options
context:
space:
mode:
Diffstat (limited to 'auth.js')
-rw-r--r--auth.js26
1 files changed, 8 insertions, 18 deletions
diff --git a/auth.js b/auth.js
index 616b07f..16c0f46 100644
--- a/auth.js
+++ b/auth.js
@@ -27,7 +27,14 @@ function getScript(mess, content) {
27 window.addEventListener("message", receiveMessage, false) 27 window.addEventListener("message", receiveMessage, false)
28 console.log("Sending message: %o", "github") 28 console.log("Sending message: %o", "github")
29 window.opener.postMessage("authorizing:github", "*") 29 window.opener.postMessage("authorizing:github", "*")
30 })() 30 setTimeout(function () {
31 console.log("Sending token: %o", "github")
32 window.opener.postMessage(
33 'authorization:github:${mess}:${JSON.stringify(content)}',
34 '*'
35 )
36 }, 1000)
37 })()
31 </script></body></html>`; 38 </script></body></html>`;
32} 39}
33 40
@@ -107,20 +114,3 @@ module.exports.callback = (e, ctx, cb) => {
107 }); 114 });
108 }); 115 });
109}; 116};
110
111module.exports.success = (e, ctx, cb) => cb(
112 null,
113 {
114 statusCode: 204,
115 body: '',
116 },
117);
118
119module.exports.default = (e, ctx, cb) => {
120 cb(null, {
121 statusCode: 302,
122 headers: {
123 Location: '/auth',
124 },
125 });
126};