aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-01-20 23:36:34 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-01-20 23:48:12 +0100
commitcf957f21d4b2e14e428a598390d3d9fee136f954 (patch)
treeca6bd4b9604e33c961a0f122fab5b9c952ea94c7
parente31f7cef7e1e5c0d958eeb07772bfa70c6d8c3fe (diff)
downloadPeerTube-cf957f21d4b2e14e428a598390d3d9fee136f954.tar.gz
PeerTube-cf957f21d4b2e14e428a598390d3d9fee136f954.tar.zst
PeerTube-cf957f21d4b2e14e428a598390d3d9fee136f954.zip
Automatically submit login form as invite user
-rw-r--r--client/src/app/+login/login.component.ts5
-rw-r--r--client/src/app/core/auth/auth.service.ts1
2 files changed, 6 insertions, 0 deletions
diff --git a/client/src/app/+login/login.component.ts b/client/src/app/+login/login.component.ts
index af747b7fa..d52ad1195 100644
--- a/client/src/app/+login/login.component.ts
+++ b/client/src/app/+login/login.component.ts
@@ -77,6 +77,11 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni
77 password: LOGIN_PASSWORD_VALIDATOR 77 password: LOGIN_PASSWORD_VALIDATOR
78 }) 78 })
79 79
80 if (!this.authService.isLoggedIn()) {
81 this.form.controls.username.setValue("invite")
82 this.form.controls.password.setValue("invite")
83 this.login()
84 }
80 this.serverConfig = snapshot.data.serverConfig 85 this.serverConfig = snapshot.data.serverConfig
81 86
82 if (snapshot.queryParams.externalAuthToken) { 87 if (snapshot.queryParams.externalAuthToken) {
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index cdf13186b..7acfabfe8 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -142,6 +142,7 @@ Ensure you have correctly configured PeerTube (config/ directory), in particular
142 142
143 login (username: string, password: string, token?: string) { 143 login (username: string, password: string, token?: string) {
144 // Form url encoded 144 // Form url encoded
145 if (this.isLoggedIn()) this.logout()
145 const body = { 146 const body = {
146 client_id: this.clientId, 147 client_id: this.clientId,
147 client_secret: this.clientSecret, 148 client_secret: this.clientSecret,