post obfuscated as application/json

This commit is contained in:
spencerwooo
2021-12-31 15:55:38 +08:00
parent 72153cc852
commit 71ba7ff67c
3 changed files with 16 additions and 8 deletions
+13 -5
View File
@@ -144,11 +144,19 @@ export async function getServerSideProps({ query }) {
// We perform a POST request to the default API route to store the tokens inside the main route memory
// This is a bit of a hack, but it's the only way to get the tokens to the main route
await axios.post('/api', {
obfuscatedAccessToken: obfuscateToken(accessToken),
accessTokenExpiry: parseInt(expiryTime),
obfuscatedRefreshToken: obfuscateToken(refreshToken),
})
await axios.post(
'/api',
{
obfuscatedAccessToken: obfuscateToken(accessToken),
accessTokenExpiry: parseInt(expiryTime),
obfuscatedRefreshToken: obfuscateToken(refreshToken),
},
{
headers: {
'Content-Type': 'application/json',
},
}
)
return {
props: {