Prosody auth, first working code:

* generated password on an api call
* use this password to authenticate on prosody
* using helper getAuthUser when available, else fallback to custom code
This commit is contained in:
John Livingston
2021-05-04 13:00:44 +02:00
parent fb7e98d20e
commit 76adc7124f
8 changed files with 204 additions and 38 deletions

View File

@ -77,6 +77,21 @@ interface MVideoThumbnail { // FIXME: this interface is not complete.
state: VideoState
}
// Keep the order
enum UserRole {
ADMINISTRATOR = 0,
MODERATOR = 1,
USER = 2
}
interface MUserAccountUrl { // FIXME: this interface is not complete
id?: string
username: string
email: string
blocked: boolean
role: UserRole
}
interface VideoBlacklistCreate {
reason?: string
unfederate?: boolean
@ -111,6 +126,10 @@ interface PeerTubeHelpers {
server: {
getServerActor: () => Promise<ActorModel>
}
// Added in Peertube 3.2.0
user?: {
getAuthUser: (res: express.Response) => MUserAccountUrl | undefined
}
}
interface RegisterServerOptions {