@ioloco/oauth
Version:
OAuth 2.0 utility library that provides helper functions for integrating third-party login providers. Designed to simplify the token exchange and user-fetch flows, while leaving API route implementation to the developer.
1 lines • 377 B
JavaScript
async function e({tokenUrl:e,clientId:t,clientSecret:c,redirectUri:r,code:i,codeVerifier:n}){const o=new URLSearchParams({grant_type:"authorization_code",client_id:t,client_secret:c,redirect_uri:r,code:i,code_verifier:n});return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:o})}export{e as fetchOAuthToken};