aboutsummaryrefslogtreecommitdiffhomepage
path: root/auth.js
diff options
context:
space:
mode:
authorPaul B <paul@bonaud.fr>2019-10-04 16:27:11 +0200
committerPaul B <paul@bonaud.fr>2019-10-21 11:57:31 +0200
commit795d7da5023114953307c28aaa60eadc5ac95882 (patch)
tree092ba207340a1b4e546807fb0570eefdcb8da106 /auth.js
parent87ba8d9b1e382604d8071b64ff6749f4db8d7e44 (diff)
downloadnetlify-serverless-oauth2-backend-795d7da5023114953307c28aaa60eadc5ac95882.tar.gz
netlify-serverless-oauth2-backend-795d7da5023114953307c28aaa60eadc5ac95882.tar.zst
netlify-serverless-oauth2-backend-795d7da5023114953307c28aaa60eadc5ac95882.zip
config: custom fretlink settings for netlify CMSnetlify-cms-custom-settings
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};