jeswr / jeswr/css-auth-utils

Login using `fetch`ing only

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Current CSS attempt

```

console.log(url)
const res = await (await fetch(url)).json();
console.log(await (await fetch('http://localhost:3000/idp/login/')).text())
console.log(await (await fetch('http://localhost:3000/idp/', {
headers: {
'sec-ch-ua': '',
accept: 'application/json',
referer: 'http://localhost:3000/idp/login/',
'sec-ch-ua-mobile': '?0',
// 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/110.0.5478.0 Safari/537.36',
'sec-ch-ua-platform': ''
}
})).text())
const postRes = await fetch(res.controls.login, {
method: 'POST',
headers: {
'sec-ch-ua': '',
accept: 'application/json',
'content-type': 'application/json',
referer: 'http://localhost:3000/idp/login/',
'sec-ch-ua-mobile': '?0',
// 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/110.0.5478.0 Safari/537.36',
'sec-ch-ua-platform': ''
},
body: JSON.stringify({ email, password, remember: "yes" })
// body: JSON.stringify({ email, password, remember: true })
})

console.log(await postRes.text())

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.