diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-05 18:04:08 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-05 18:04:08 +0200 |
commit | 629d8d6f70cf83b55011dff53bfe1c4a95ac3433 (patch) | |
tree | 9d5a145609d9c693ddacfbc42ae75ca3c841aef0 /client/src/app/account/account.service.ts | |
parent | 99a64bfed25e45547df3045cf249bc895e6f220b (diff) | |
download | PeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.tar.gz PeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.tar.zst PeerTube-629d8d6f70cf83b55011dff53bfe1c4a95ac3433.zip |
Client: implement password change
Diffstat (limited to 'client/src/app/account/account.service.ts')
-rw-r--r-- | client/src/app/account/account.service.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/app/account/account.service.ts b/client/src/app/account/account.service.ts new file mode 100644 index 000000000..19b4e0624 --- /dev/null +++ b/client/src/app/account/account.service.ts | |||
@@ -0,0 +1,19 @@ | |||
1 | import { Injectable } from '@angular/core'; | ||
2 | |||
3 | import { AuthHttp, AuthService } from '../shared'; | ||
4 | |||
5 | @Injectable() | ||
6 | export class AccountService { | ||
7 | private static BASE_USERS_URL = '/api/v1/users/'; | ||
8 | |||
9 | constructor(private authHttp: AuthHttp, private authService: AuthService) { } | ||
10 | |||
11 | changePassword(newPassword: string) { | ||
12 | const url = AccountService.BASE_USERS_URL + this.authService.getUser().id; | ||
13 | const body = { | ||
14 | password: newPassword | ||
15 | }; | ||
16 | |||
17 | return this.authHttp.put(url, body); | ||
18 | } | ||
19 | } | ||