aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/users/components
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-27 16:23:10 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-27 16:23:10 +0200
commit41a2aee38cf812510010da09de9bae53590ec119 (patch)
tree79d55d6ae0ef6f66ccb88890cf1ef1946dc65fb4 /client/angular/users/components
parent157cb9c9713e08ff70078660a32dd77ecb87eabc (diff)
downloadPeerTube-41a2aee38cf812510010da09de9bae53590ec119.tar.gz
PeerTube-41a2aee38cf812510010da09de9bae53590ec119.tar.zst
PeerTube-41a2aee38cf812510010da09de9bae53590ec119.zip
Follow the angular styleguide for the directories structure
Diffstat (limited to 'client/angular/users/components')
-rw-r--r--client/angular/users/components/login/login.component.html14
-rw-r--r--client/angular/users/components/login/login.component.scss0
-rw-r--r--client/angular/users/components/login/login.component.ts36
3 files changed, 0 insertions, 50 deletions
diff --git a/client/angular/users/components/login/login.component.html b/client/angular/users/components/login/login.component.html
deleted file mode 100644
index 940694515..000000000
--- a/client/angular/users/components/login/login.component.html
+++ /dev/null
@@ -1,14 +0,0 @@
1<h3>Login</h3>
2<form role="form" (submit)="login(username.value, password.value)">
3 <div class="form-group">
4 <label for="username">Username</label>
5 <input type="text" #username class="form-control" id="username" placeholder="Username">
6 </div>
7
8 <div class="form-group">
9 <label for="password">Password</label>
10 <input type="password" #password class="form-control" id="password" placeholder="Password">
11 </div>
12
13 <input type="submit" value="Login" class="btn btn-default">
14</form>
diff --git a/client/angular/users/components/login/login.component.scss b/client/angular/users/components/login/login.component.scss
deleted file mode 100644
index e69de29bb..000000000
--- a/client/angular/users/components/login/login.component.scss
+++ /dev/null
diff --git a/client/angular/users/components/login/login.component.ts b/client/angular/users/components/login/login.component.ts
deleted file mode 100644
index d339353ef..000000000
--- a/client/angular/users/components/login/login.component.ts
+++ /dev/null
@@ -1,36 +0,0 @@
1import { Component } from '@angular/core';
2import { Router } from '@angular/router-deprecated';
3
4import { AuthService } from '../../services/auth.service';
5import { AuthStatus } from '../../models/authStatus';
6import { User } from '../../models/user';
7
8@Component({
9 selector: 'my-user-login',
10 styleUrls: [ 'app/angular/users/components/login/login.component.css' ],
11 templateUrl: 'app/angular/users/components/login/login.component.html'
12})
13
14export class UserLoginComponent {
15 constructor(private _authService: AuthService, private _router: Router) {}
16
17 login(username: string, password: string) {
18 this._authService.login(username, password).subscribe(
19 result => {
20 const user = new User(username, result);
21 user.save();
22
23 this._authService.setStatus(AuthStatus.LoggedIn);
24
25 this._router.navigate(['VideosList']);
26 },
27 error => {
28 if (error.error === 'invalid_grant') {
29 alert('Credentials are invalid.');
30 } else {
31 alert(`${error.error}: ${error.error_description}`);
32 }
33 }
34 );
35 }
36}