Add external auth support
This commit is contained in:
		| @ -1,3 +1,3 @@ | |||||||
| body { | .header-right  { | ||||||
|   --mainBackgroundColor: black !important; |   background-color: black; | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,3 +1,3 @@ | |||||||
| body { | .upload-button { | ||||||
|   color: white !important; |   background-color: red !important; | ||||||
| } | } | ||||||
|  | |||||||
| @ -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 () { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user