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 { .header-right {
--mainBackgroundColor: black !important; background-color: black;
} }

View File

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

View File

@ -6,7 +6,8 @@ async function register ({
storageManager, storageManager,
videoCategoryManager, videoCategoryManager,
videoLicenceManager, videoLicenceManager,
videoLanguageManager videoLanguageManager,
registerExternalAuth
}) { }) {
const defaultAdmin = 'PeerTube admin' const defaultAdmin = 'PeerTube admin'
@ -79,6 +80,21 @@ async function register ({
router.post('/form/post/mirror', (req, res) => { router.post('/form/post/mirror', (req, res) => {
res.json(req.body) 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 () { async function unregister () {