mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
docs: expose expires_in for authentication
This commit is contained in:
parent
bd39e2aa12
commit
00a09ca894
|
@ -31,7 +31,7 @@ module.exports = async function (context, req) {
|
||||||
redirect(context, segment, tokens, '');
|
redirect(context, segment, tokens, '');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
context.log(`Error: ${error.stack}`);
|
context.log(`Error: ${error.stack}`);
|
||||||
let buff = new Buffer(error.stack);
|
let buff = Buffer.from(error.stack);
|
||||||
let message = buff.toString('base64');
|
let message = buff.toString('base64');
|
||||||
redirect(context, segment, tokens, message);
|
redirect(context, segment, tokens, message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,11 +9,11 @@ async function getStravaToken(code) {
|
||||||
};
|
};
|
||||||
const resp = await axios.post('https://www.strava.com/api/v3/oauth/token', null, { params: params });
|
const resp = await axios.post('https://www.strava.com/api/v3/oauth/token', null, { params: params });
|
||||||
|
|
||||||
const body = {
|
return {
|
||||||
access_token: resp.data.access_token,
|
access_token: resp.data.access_token,
|
||||||
refresh_token: resp.data.refresh_token,
|
refresh_token: resp.data.refresh_token,
|
||||||
}
|
expires_in: resp.data.expires_in
|
||||||
return body;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refreshStravaToken(refresh_token) {
|
async function refreshStravaToken(refresh_token) {
|
||||||
|
@ -25,11 +25,11 @@ async function refreshStravaToken(refresh_token) {
|
||||||
};
|
};
|
||||||
const resp = await axios.post('https://www.strava.com/api/v3/oauth/token', null, { params: params });
|
const resp = await axios.post('https://www.strava.com/api/v3/oauth/token', null, { params: params });
|
||||||
|
|
||||||
const body = {
|
return {
|
||||||
access_token: resp.data.access_token,
|
access_token: resp.data.access_token,
|
||||||
refresh_token: resp.data.refresh_token,
|
refresh_token: resp.data.refresh_token,
|
||||||
}
|
expires_in: resp.data.expires_in
|
||||||
return body;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue