]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js
1 async
function register ({
5 registerIdAndPassAuth({
6 authName: 'laguna-auth',
9 peertubeHelpers
.logger
.info('On logout for auth 2 - 1')
14 hookTokenValidity: (options
) => {
15 if (options
.type
=== 'refresh') {
16 return { valid: false }
19 if (options
.type
=== 'access') {
20 const token
= options
.token
21 const now
= new Date()
22 now
.setTime(now
.getTime() - 5000)
24 const createdAt
= new Date(token
.createdAt
)
26 return { valid: createdAt
.getTime() >= now
.getTime() }
29 return { valid: true }
33 if (body
.id
=== 'laguna' && body
.password
=== 'laguna password') {
34 return Promise
.resolve({
36 email: 'laguna@example.com',
37 displayName: 'Laguna Loire',
40 videoQuotaDaily: 42100,
42 // Always use new value except for videoQuotaDaily field
43 userUpdater: ({ fieldName
, currentValue
, newValue
}) => {
44 if (fieldName
=== 'videoQuotaDaily') return currentValue
56 async
function unregister () {
65 // ###########################################################################