Error while trying to revoke token
Hi,
I have been able to successfully login using my app's client secret & id but I can't revoke users' auth token as I keep on getting CORS related error
const data = `client_id=${clientId}&client_secret=${clientSecret}&token=${refresh_token}`
axios
.post('https://api.box.com/oauth2/revoke', data, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
})
.then(() => {
console.log('Logout success')
dispatch({ type: USER_LOGOUT })
})
.catch(error => console.error(error))
window.fetch(`https://api.box.com/oauth2/revoke`, {
method: 'POST',
body: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
}).then(() => {
console.log('Logout success')
dispatch({type: USER_LOGOUT})
}).catch(error => console.error(error))
I made the post request using both fetch and axis but I get the same error. Any ideas on what's going wrong here?
Appreciate all the help!
EDIT: I am using oAuth2 for user authentication
サインインしてコメントを残してください。
コメント
2件のコメント