diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6d095cc47..4b352922e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -44,7 +44,9 @@ before you start working on them :). ### Prerequisites -First, make sure that you have followed +First, you should use a server or PC with at least 4GB of RAM. Less RAM may lead to crashes. + +Make sure that you have followed [the steps](/support/doc/dependencies.md) to install the dependencies. @@ -173,4 +175,4 @@ $ npm run mocha -- --exit --require ts-node/register/type-check --bail server/te ``` Instance configurations are in `config/test-{1,2,3,4,5,6}.yaml`. -Note that only instance 2 has transcoding enabled. \ No newline at end of file +Note that only instance 2 has transcoding enabled. diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 88ea89639..8ff5713a1 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -38,6 +38,7 @@ export class AuthService { loginChangedSource: Observable userInformationLoaded = new ReplaySubject(1) hotkeys: Hotkey[] + redirectUrl: string private clientId: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID) private clientSecret: string = peertubeLocalStorage.getItem(AuthService.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET) @@ -177,6 +178,8 @@ export class AuthService { this.setStatus(AuthStatus.LoggedOut) this.hotkeysService.remove(this.hotkeys) + + this.redirectUrl = null } refreshAccessToken () { diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts index 18bc41ca6..40ff8f505 100644 --- a/client/src/app/core/routing/login-guard.service.ts +++ b/client/src/app/core/routing/login-guard.service.ts @@ -20,6 +20,8 @@ export class LoginGuard implements CanActivate, CanActivateChild { canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { if (this.auth.isLoggedIn() === true) return true + this.auth.redirectUrl = state.url + this.router.navigate([ '/login' ]) return false } diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 267a2d857..fa585c883 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html @@ -19,7 +19,7 @@ or create an account - diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 4bae3ae5c..7553e6456 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts @@ -8,6 +8,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill' import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service' import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' +import { Router } from '@angular/router' @Component({ selector: 'my-login', @@ -26,6 +27,7 @@ export class LoginComponent extends FormReactive implements OnInit { private openedForgotPasswordModal: NgbModalRef constructor ( + public router: Router, protected formValidatorService: FormValidatorService, private modalService: NgbModal, private loginValidatorsService: LoginValidatorsService, @@ -59,7 +61,7 @@ export class LoginComponent extends FormReactive implements OnInit { this.authService.login(username, password) .subscribe( - () => this.redirectService.redirectToHomepage(), + () => this.redirect(), err => { if (err.message.indexOf('credentials are invalid') !== -1) this.error = this.i18n('Incorrect username or password.') @@ -69,6 +71,15 @@ export class LoginComponent extends FormReactive implements OnInit { ) } + redirect () { + const redirect = this.authService.redirectUrl + if (redirect) { + this.router.navigate([ redirect ]) + } else { + this.redirectService.redirectToHomepage() + } + } + askResetPassword () { this.userService.askResetPassword(this.forgotPasswordEmail) .subscribe( diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.html index 5b3ddde1d..28ccb1e26 100644 --- a/client/src/app/shared/misc/help.component.html +++ b/client/src/app/shared/misc/help.component.html @@ -15,6 +15,7 @@ - +
{{ video.durationLabel }} diff --git a/client/src/app/videos/+video-watch/modal/video-download.component.html b/client/src/app/videos/+video-watch/modal/video-download.component.html index edd054123..f46f92a17 100644 --- a/client/src/app/videos/+video-watch/modal/video-download.component.html +++ b/client/src/app/videos/+video-watch/modal/video-download.component.html @@ -5,10 +5,20 @@