Add external auth support

This commit is contained in:
Chocobozzz 2020-04-28 14:58:40 +02:00
parent 3fb4c2483d
commit ff355beb00
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 21 additions and 5 deletions

View File

@ -1,3 +1,3 @@
body {
--mainBackgroundColor: black !important;
.header-right {
background-color: black;
}

View File

@ -1,3 +1,3 @@
body {
color: white !important;
.upload-button {
background-color: red !important;
}

View File

@ -6,7 +6,8 @@ async function register ({
storageManager,
videoCategoryManager,
videoLicenceManager,
videoLanguageManager
videoLanguageManager,
registerExternalAuth
}) {
const defaultAdmin = 'PeerTube admin'
@ -79,6 +80,21 @@ async function register ({
router.post('/form/post/mirror', (req, res) => {
res.json(req.body)
})
{
const result = registerExternalAuth({
authName: 'fake-auth',
authDisplayName: 'fake auth',
onAuthRequest: (req, res) => {
result.userAuthenticated({
req,
res,
username: 'fake_auth_username',
email: 'fake_auth_username@example.com'
})
}
})
}
}
async function unregister () {