forked from cory/tildefriends
Cory McWilliams
09c7c8ac64
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4380 ed5197a5-7fde-0310-b194-c3ffbd925b24
20 lines
502 B
JavaScript
20 lines
502 B
JavaScript
import * as strava from './strava.js';
|
|
|
|
async function main() {
|
|
let r = await strava.authorization_code(request.query.code);
|
|
print('state =', request.query.state);
|
|
print('body = ', r.body);
|
|
if (request.query.state && r.body) {
|
|
let shared_db = await shared_database('state');
|
|
await shared_db.set(request.query.state, r.body);
|
|
}
|
|
await respond({
|
|
data: r.body,
|
|
content_type: 'text/plain',
|
|
headers: {
|
|
Location: 'https://tildefriends.net/~cory/gg/',
|
|
},
|
|
status_code: 307,
|
|
});
|
|
}
|
|
main(); |