Make URL of oauth application dynamic
This commit is contained in:
parent
a7eaec3391
commit
6f9b079aa8
|
@ -1,17 +1,17 @@
|
||||||
import { post, paramsString, WRITE_TIMEOUT } from '../_utils/ajax.js'
|
import { post, paramsString, WRITE_TIMEOUT } from '../_utils/ajax.js'
|
||||||
import { basename } from './utils.js'
|
import { basename } from './utils.js'
|
||||||
|
|
||||||
const WEBSITE = 'https://semaphore.social'
|
|
||||||
const SCOPES = 'read write follow push'
|
const SCOPES = 'read write follow push'
|
||||||
const CLIENT_NAME = 'Semaphore'
|
const CLIENT_NAME = 'Semaphore'
|
||||||
|
|
||||||
export function registerApplication (instanceName, redirectUri) {
|
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, {
|
return post(url, {
|
||||||
client_name: CLIENT_NAME,
|
client_name: CLIENT_NAME,
|
||||||
redirect_uris: redirectUri,
|
redirect_uris: redirectUri,
|
||||||
scopes: SCOPES,
|
scopes: SCOPES,
|
||||||
website: WEBSITE
|
website: website
|
||||||
}, null, { timeout: WRITE_TIMEOUT })
|
}, null, { timeout: WRITE_TIMEOUT })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue