You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, sumad200, I dont know how to contact with you so I write here.
I try to do local project for personal usage to check what's new in my valorant shop and night market from my telegram bot.
But I have error on auth, I use bun (or nodejs) for my app.
Here my code
// Make the first request to obtain session cookies
const step1Response = await fetch('https://auth.riotgames.com/api/v1/authorization', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
client_id: 'riot-client',
code_challenge: '',
code_challenge_method: '',
acr_values: '',
claims: '',
nonce: '69420',
redirect_uri: 'http://localhost/redirect',
response_type: 'token id_token',
scope: 'openid link ban lol_region',
}),
})
// Check the response status and cookies
if (!step1Response.ok) {
console.error('Step 1 failed:', await step1Response.text())
return
}
// Extract cookies from the response
const setCookieHeader = step1Response.headers.get('set-cookie')
if (!setCookieHeader) {
console.error('No cookies received from Step 1')
return
}
// Prepare cookies for the second request
const cookies = setCookieHeader.split(', ').map(cookie => cookie.split(';')[0]).join('; ')
// Make the second request using the cookies
const step2Response = await fetch('https://auth.riotgames.com/api/v1/authorization', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Cookie': cookies, // Pass cookies from Step 1
},
body: JSON.stringify({
remember: true,
type: 'auth',
username: process.env.RIOT_USERNAME,
password: process.env.RIOT_PASSWORD,
}),
})
console.log(
process.env.RIOT_USERNAME,
process.env.RIOT_PASSWORD,
)
const step2Data = await step2Response.json()
if (!step2Response.ok) {
console.error('Step 2 failed:', step2Data)
} else {
console.log('Step 2 successful:', step2Data)
}
}
test()
but server respond me 200, but with next response:
Hey @rudnik275, The auth endpoint request body has changed .I've switched to using a webview for authentication. So, I no longer update any auth endpoint related code in my app. You should check out these resources for the latest info.
I also suggest you try getting the auth flow right first using postman/insomnia before coding, Also you can take a look at this discord bot repo (in python) as it matches your use case more closely.
Hello, sumad200, I dont know how to contact with you so I write here.
I try to do local project for personal usage to check what's new in my valorant shop and night market from my telegram bot.
But I have error on auth, I use bun (or nodejs) for my app.
Here my code
but server respond me 200, but with next response:
What I doing wrong?
The text was updated successfully, but these errors were encountered: