I forgot my password
diff --git a/client/src/app/login/login.component.scss b/client/src/app/login/login.component.scss
index 2cf6991ce..4a37ee961 100644
--- a/client/src/app/login/login.component.scss
+++ b/client/src/app/login/login.component.scss
@@ -1,9 +1,15 @@
@import '_variables';
@import '_mixins';
+label {
+ display: block;
+}
+
input:not([type=submit]) {
@include peertube-input-text(340px);
- display: block;
+ display: inline-block;
+ margin-right: 5px;
+
}
input[type=submit] {
@@ -11,12 +17,13 @@ input[type=submit] {
@include orange-button;
}
-input[type=password] {
- display: inline-block;
- margin-right: 5px;
-}
-
.forgot-password-button {
display: inline-block;
cursor: pointer;
}
+
+.create-an-account {
+ @include disable-default-a-behaviour;
+
+ color: #000;
+}
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index 22e8c77dd..f7b49ec45 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -1,6 +1,7 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
import { FormBuilder, FormGroup, Validators } from '@angular/forms'
import { Router } from '@angular/router'
+import { RedirectService, ServerService } from '@app/core'
import { UserService } from '@app/shared'
import { NotificationsService } from 'angular2-notifications'
import { ModalDirective } from 'ngx-bootstrap/modal'
@@ -34,16 +35,20 @@ export class LoginComponent extends FormReactive implements OnInit {
}
forgotPasswordEmail = ''
- constructor (
- private authService: AuthService,
- private userService: UserService,
- private notificationsService: NotificationsService,
- private formBuilder: FormBuilder,
- private router: Router
- ) {
+ constructor (private authService: AuthService,
+ private userService: UserService,
+ private serverService: ServerService,
+ private redirectService: RedirectService,
+ private notificationsService: NotificationsService,
+ private formBuilder: FormBuilder,
+ private router: Router) {
super()
}
+ get signupAllowed () {
+ return this.serverService.getConfig().signup.allowed === true
+ }
+
buildForm () {
this.form = this.formBuilder.group({
username: [ '', Validators.required ],
@@ -62,11 +67,12 @@ export class LoginComponent extends FormReactive implements OnInit {
const { username, password } = this.form.value
- this.authService.login(username, password).subscribe(
- () => this.router.navigate(['/videos/list']),
+ this.authService.login(username, password)
+ .subscribe(
+ () => this.redirectService.redirectToHomepage(),
- err => this.error = err.message
- )
+ err => this.error = err.message
+ )
}
askResetPassword () {
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html
index bacbe9cdb..e37d93b62 100644
--- a/client/src/app/shared/misc/help.component.html
+++ b/client/src/app/shared/misc/help.component.html
@@ -12,7 +12,7 @@
-
+>