mirror of
https://github.com/gurnec/removeddit.git
synced 2026-03-11 08:54:27 +00:00
Partially revert commit 16d6652
This commit is contained in:
parent
842061ef2b
commit
6d5585591d
1 changed files with 2 additions and 5 deletions
|
|
@ -5,7 +5,6 @@ import { fetchJson } from '../../utils'
|
||||||
|
|
||||||
// Current using dummy ID from throwaway
|
// Current using dummy ID from throwaway
|
||||||
const clientID = 'ZmYXJ5RaSDhF-77YaFulWw'
|
const clientID = 'ZmYXJ5RaSDhF-77YaFulWw'
|
||||||
const userAgent = 'com.unddit.www (by /u/unddit-com)'
|
|
||||||
|
|
||||||
// Token for reddit API
|
// Token for reddit API
|
||||||
let token
|
let token
|
||||||
|
|
@ -20,8 +19,7 @@ const getToken = () => {
|
||||||
const tokenInit = {
|
const tokenInit = {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Basic ${window.btoa(`${clientID}:`)}`,
|
Authorization: `Basic ${window.btoa(`${clientID}:`)}`,
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
|
||||||
'User-Agent': userAgent
|
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: `grant_type=${encodeURIComponent('https://oauth.reddit.com/grants/installed_client')}&device_id=DO_NOT_TRACK_THIS_DEVICE`
|
body: `grant_type=${encodeURIComponent('https://oauth.reddit.com/grants/installed_client')}&device_id=DO_NOT_TRACK_THIS_DEVICE`
|
||||||
|
|
@ -43,8 +41,7 @@ export const getAuth = () => {
|
||||||
return getToken()
|
return getToken()
|
||||||
.then(token => ({
|
.then(token => ({
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `bearer ${token}`,
|
Authorization: `bearer ${token}`
|
||||||
'User-Agent': userAgent
|
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue