ニジカ投稿局 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.
 
 
 
 
 

107 lines
1.8 KiB

  1. async function register ({
  2. registerIdAndPassAuth,
  3. peertubeHelpers
  4. }) {
  5. registerIdAndPassAuth({
  6. authName: 'laguna-bad-auth',
  7. onLogout: () => {
  8. peertubeHelpers.logger.info('On logout for auth 3 - 1')
  9. },
  10. getWeight: () => 5,
  11. login (body) {
  12. if (body.id === 'laguna' && body.password === 'laguna password') {
  13. return Promise.resolve({
  14. username: 'laguna',
  15. email: 'laguna@example.com',
  16. displayName: 'Laguna Loire'
  17. })
  18. }
  19. return null
  20. }
  21. })
  22. registerIdAndPassAuth({
  23. authName: 'ward-auth',
  24. getWeight: () => 5,
  25. login (body) {
  26. if (body.id === 'ward') {
  27. return Promise.resolve({
  28. username: '-ward-42',
  29. email: 'ward@example.com'
  30. })
  31. }
  32. return null
  33. }
  34. })
  35. registerIdAndPassAuth({
  36. authName: 'kiros-auth',
  37. getWeight: () => 5,
  38. login (body) {
  39. if (body.id === 'kiros') {
  40. return Promise.resolve({
  41. username: 'kiros',
  42. email: 'kiros@example.com',
  43. displayName: 'a'.repeat(5000)
  44. })
  45. }
  46. return null
  47. }
  48. })
  49. registerIdAndPassAuth({
  50. authName: 'raine-auth',
  51. getWeight: () => 5,
  52. login (body) {
  53. if (body.id === 'raine') {
  54. return Promise.resolve({
  55. username: 'raine',
  56. email: 'raine@example.com',
  57. role: 42
  58. })
  59. }
  60. return null
  61. }
  62. })
  63. registerIdAndPassAuth({
  64. authName: 'ellone-auth',
  65. getWeight: () => 5,
  66. login (body) {
  67. if (body.id === 'ellone') {
  68. return Promise.resolve({
  69. username: 'ellone'
  70. })
  71. }
  72. return null
  73. }
  74. })
  75. }
  76. async function unregister () {
  77. return
  78. }
  79. module.exports = {
  80. register,
  81. unregister
  82. }
  83. // ###########################################################################