1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { quickShareCreateSession } from "https://esm.town/v/mcwhittemore/quickShareCreateSession";
export let quickShareGithubLanding = async (req, res) => {
const { code, state } = req.query;
const session = await quickShareCreateSession({ code, state });
res.send(`<body>
<h1>Welcome to Quick Share</h1>
<p>We will direct you to the app in a second</p>
<script>
cookieStore.set('quick-share-session', '${session}').then(() => {
setTimeout(() => {
window.location = 'https://api.val.town/express/@mcwhittemore.quickShareAppPage'
}, 1000);
}).catch(() => {
alert('error saving session data');
})
</script>
</body>`);
};