|
|
|
@ -4,9 +4,9 @@ const instance = 'https://chat.brainbaking.com'
|
|
|
|
|
const clientName = "plerobuddies"
|
|
|
|
|
|
|
|
|
|
// Fill these in after register() ed. calls
|
|
|
|
|
const clientId = ""
|
|
|
|
|
const clientSecret = ""
|
|
|
|
|
const approvalCode = ""
|
|
|
|
|
let clientId = ""
|
|
|
|
|
let clientSecret = ""
|
|
|
|
|
let approvalCode = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function register() {
|
|
|
|
@ -16,6 +16,7 @@ async function register() {
|
|
|
|
|
scopes: "read write"
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
clientId = raw.data['client_id']
|
|
|
|
|
|
|
|
|
|
console.log(raw.data)
|
|
|
|
|
console.log(`${instance}/oauth/authorize?redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=${clientId}&scope=read%20write`)
|
|
|
|
@ -39,7 +40,8 @@ async function fetchToken() {
|
|
|
|
|
|
|
|
|
|
(async function() {
|
|
|
|
|
try {
|
|
|
|
|
await fetchToken()
|
|
|
|
|
await register()
|
|
|
|
|
//await fetchToken()
|
|
|
|
|
} catch(err) {
|
|
|
|
|
console.log(err.message)
|
|
|
|
|
console.log(err.response?.data)
|
|
|
|
|