Make URL of oauth application dynamic

This commit is contained in:
Max Rosin 2023-08-08 21:28:16 +02:00
parent a7eaec3391
commit 6f9b079aa8
1 changed files with 3 additions and 3 deletions

View File

@ -1,17 +1,17 @@
import { post, paramsString, WRITE_TIMEOUT } from '../_utils/ajax.js'
import { basename } from './utils.js'
const WEBSITE = 'https://semaphore.social'
const SCOPES = 'read write follow push'
const CLIENT_NAME = 'Semaphore'
export function registerApplication (instanceName, redirectUri) {
const url = `${basename(instanceName)}/api/v1/apps`
const website = basename(instanceName)
const url = `${website}/api/v1/apps`
return post(url, {
client_name: CLIENT_NAME,
redirect_uris: redirectUri,
scopes: SCOPES,
website: WEBSITE
website: website
}, null, { timeout: WRITE_TIMEOUT })
}