+ it('Should reject an invalid username, email, role or display name', async function () {
+ await userLogin(server, { username: 'ward', password: 'ward password' }, 400)
+ await waitUntilLog(server, 'valid username')
+
+ await userLogin(server, { username: 'kiros', password: 'kiros password' }, 400)
+ await waitUntilLog(server, 'valid display name')
+
+ await userLogin(server, { username: 'raine', password: 'raine password' }, 400)
+ await waitUntilLog(server, 'valid role')
+
+ await userLogin(server, { username: 'ellone', password: 'elonne password' }, 400)
+ await waitUntilLog(server, 'valid email')
+ })
+
+ it('Should unregister spyro-auth and do not login existing Spyro', async function () {
+ await updatePluginSettings({
+ url: server.url,
+ accessToken: server.accessToken,
+ npmName: 'peertube-plugin-test-id-pass-auth-one',
+ settings: { disableSpyro: true }
+ })
+
+ await userLogin(server, { username: 'spyro', password: 'spyro password' }, 400)
+ await userLogin(server, { username: 'spyro', password: 'fake' }, 400)
+ })
+
+ it('Should have disabled this auth', async function () {
+ const res = await getConfig(server.url)
+
+ const config: ServerConfig = res.body
+
+ const auths = config.plugin.registeredIdAndPassAuths
+ expect(auths).to.have.lengthOf(7)
+
+ const spyroAuth = auths.find(a => a.authName === 'spyro-auth')
+ expect(spyroAuth).to.not.exist
+ })
+