ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
1.2 KiB

  1. async function register ({
  2. registerExternalAuth,
  3. peertubeHelpers
  4. }) {
  5. {
  6. const result = registerExternalAuth({
  7. authName: 'external-auth-7',
  8. authDisplayName: () => 'External Auth 7',
  9. onAuthRequest: (req, res) => {
  10. result.userAuthenticated({
  11. req,
  12. res,
  13. username: 'cid',
  14. email: 'cid@example.com',
  15. displayName: 'Cid Marquez'
  16. })
  17. },
  18. onLogout: (user, req) => {
  19. return 'https://example.com/redirectUrl'
  20. }
  21. })
  22. }
  23. {
  24. const result = registerExternalAuth({
  25. authName: 'external-auth-8',
  26. authDisplayName: () => 'External Auth 8',
  27. onAuthRequest: (req, res) => {
  28. result.userAuthenticated({
  29. req,
  30. res,
  31. username: 'cid',
  32. email: 'cid@example.com',
  33. displayName: 'Cid Marquez'
  34. })
  35. },
  36. onLogout: (user, req) => {
  37. return 'https://example.com/redirectUrl?access_token=' + req.headers['authorization'].split(' ')[1]
  38. }
  39. })
  40. }
  41. }
  42. async function unregister () {
  43. }
  44. module.exports = {
  45. register,
  46. unregister
  47. }
  48. // ###########################################################################