Add server domain
This commit is contained in:
parent
857360c4d2
commit
bbe5e468ce
@ -4,7 +4,7 @@ import adminAccessToken from '../config/synapse_access_token.json'
|
||||
import { IdMapping } from '../entity/IdMapping'
|
||||
import log from '../helpers/logger'
|
||||
import { createMembership, getUserId, save } from '../helpers/storage'
|
||||
import { axios } from '../helpers/synapse'
|
||||
import { axios, getUserDomain } from '../helpers/synapse'
|
||||
|
||||
export type RcUser = {
|
||||
_id: string
|
||||
@ -76,7 +76,7 @@ async function registerUser(user: MatrixUser): Promise<AccessToken> {
|
||||
}
|
||||
|
||||
async function userAlreadyExists(user: MatrixUser): Promise<boolean> {
|
||||
const user_data = (await axios.get('/_synapse/admin/v2/users/' + user.username)).data
|
||||
const user_data = (await axios.get('/_synapse/admin/v2/users/@' + user.username + ":" + getUserDomain())).data
|
||||
log.debug(`Mapping exists:`, user_data)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -14,6 +14,10 @@ export interface SessionOptions {
|
||||
[others: string]: unknown
|
||||
}
|
||||
|
||||
export function getUserDomain(): string {
|
||||
return "m-rc.jennett-wheeler.co.uk"
|
||||
}
|
||||
|
||||
export { default as axios } from 'axios'
|
||||
export const whoami = () =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user