Partially revert commit 16d6652

This commit is contained in:
Christopher Gurnee 2021-11-04 14:14:57 +00:00
parent 842061ef2b
commit 6d5585591d

View file

@ -5,7 +5,6 @@ import { fetchJson } from '../../utils'
// Current using dummy ID from throwaway
const clientID = 'ZmYXJ5RaSDhF-77YaFulWw'
const userAgent = 'com.unddit.www (by /u/unddit-com)'
// Token for reddit API
let token
@ -20,8 +19,7 @@ const getToken = () => {
const tokenInit = {
headers: {
Authorization: `Basic ${window.btoa(`${clientID}:`)}`,
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
'User-Agent': userAgent
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
},
method: 'POST',
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()
.then(token => ({
headers: {
Authorization: `bearer ${token}`,
'User-Agent': userAgent
Authorization: `bearer ${token}`
}
}))
}