]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Automatically submit login form as invite user
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 20 Jan 2021 22:36:34 +0000 (23:36 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 20 Jan 2021 22:48:12 +0000 (23:48 +0100)
client/src/app/+login/login.component.ts
client/src/app/core/auth/auth.service.ts

index af747b7fa080efc6e1296b56de44b3130ad03324..d52ad11956bacb41e0d8be129edf8e5d241bbdaa 100644 (file)
@@ -77,6 +77,11 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
       password: LOGIN_PASSWORD_VALIDATOR
     })
 
+    if (!this.authService.isLoggedIn()) {
+        this.form.controls.username.setValue("invite")
+        this.form.controls.password.setValue("invite")
+        this.login()
+    }
     this.serverConfig = snapshot.data.serverConfig
 
     if (snapshot.queryParams.externalAuthToken) {
index cdf13186b68f3338dc49ba687f0eed411c1bf0f8..7acfabfe82dab3f4e21b16c7733dcb7509da6fd0 100644 (file)
@@ -142,6 +142,7 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular
 
   login (username: string, password: string, token?: string) {
     // Form url encoded
+    if (this.isLoggedIn()) this.logout()
     const body = {
       client_id: this.clientId,
       client_secret: this.clientSecret,