refresh to readme send back error

This commit is contained in:
2024-01-11 14:20:55 +01:00
parent 294a496626
commit da58267b13
2 changed files with 9 additions and 2 deletions

View File

@@ -20,4 +20,11 @@ https://example.vercel.app/authorize?port=4200
https://localhost:4200/{CALLBACK_URL}?access_token={access_token}&refresh_token={refresh_token}&expires_in={expires_in} https://localhost:4200/{CALLBACK_URL}?access_token={access_token}&refresh_token={refresh_token}&expires_in={expires_in}
7. profit? 7. profit?
To resfresh the token request this
POST:
https://example.vercel.app/refresh?port=4200
body: refresh_token : {refreshtoken}
new token should be send like in 6
## use at own risk, security holes might be in there ## use at own risk, security holes might be in there

View File

@@ -60,7 +60,7 @@ app.get('/refresh', (req, res) => {
console.log(data) console.log(data)
res.redirect(`http://localhost:${callbackport}/${process.env.CALLBACK_URL}?access_token=${data.access_token}&refresh_token=${data.refresh_token}&expires_in=${data.expires_in}`); res.redirect(`http://localhost:${callbackport}/${process.env.CALLBACK_URL}?access_token=${data.access_token}&refresh_token=${data.refresh_token}&expires_in=${data.expires_in}`);
}) })
.catch(error => console.error('Error:', error)); .catch(error => res.json(error));
} catch (error) { } catch (error) {
console.error(error); console.error(error);