diff options
author | Paul B <paul@bonaud.fr> | 2019-10-04 16:27:11 +0200 |
---|---|---|
committer | Paul B <paul@bonaud.fr> | 2019-10-21 11:57:31 +0200 |
commit | 795d7da5023114953307c28aaa60eadc5ac95882 (patch) | |
tree | 092ba207340a1b4e546807fb0570eefdcb8da106 /auth.js | |
parent | 87ba8d9b1e382604d8071b64ff6749f4db8d7e44 (diff) | |
download | netlify-serverless-oauth2-backend-netlify-cms-custom-settings.tar.gz netlify-serverless-oauth2-backend-netlify-cms-custom-settings.tar.zst netlify-serverless-oauth2-backend-netlify-cms-custom-settings.zip |
config: custom fretlink settings for netlify CMSnetlify-cms-custom-settings
Diffstat (limited to 'auth.js')
-rw-r--r-- | auth.js | 26 |
1 files changed, 8 insertions, 18 deletions
@@ -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 | |||
111 | module.exports.success = (e, ctx, cb) => cb( | ||
112 | null, | ||
113 | { | ||
114 | statusCode: 204, | ||
115 | body: '', | ||
116 | }, | ||
117 | ); | ||
118 | |||
119 | module.exports.default = (e, ctx, cb) => { | ||
120 | cb(null, { | ||
121 | statusCode: 302, | ||
122 | headers: { | ||
123 | Location: '/auth', | ||
124 | }, | ||
125 | }); | ||
126 | }; | ||