15 lines
374 B
JavaScript
15 lines
374 B
JavaScript
|
const authCode = new URL(document.location).searchParams.get('code')
|
||
|
|
||
|
if(typeof authCode !== undefined) {
|
||
|
fetch('https://crss-api.theclashfruit.workers.dev/login', {
|
||
|
method: 'POST',
|
||
|
headers: {
|
||
|
'Content-Type': 'application/json'
|
||
|
},
|
||
|
body: JSON.stringify({ authCode })
|
||
|
})
|
||
|
.then(res => res.text())
|
||
|
.then(res => {
|
||
|
console.log(res)
|
||
|
})
|
||
|
}
|