aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/users/user.service.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 742fb0728..da7b583f4 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -5,7 +5,6 @@ import 'rxjs/add/operator/map'
5import { UserCreate, UserUpdateMe } from '../../../../../shared' 5import { UserCreate, UserUpdateMe } from '../../../../../shared'
6import { environment } from '../../../environments/environment' 6import { environment } from '../../../environments/environment'
7import { RestExtractor } from '../rest' 7import { RestExtractor } from '../rest'
8import { User } from './user.model'
9 8
10@Injectable() 9@Injectable()
11export class UserService { 10export class UserService {
@@ -54,4 +53,24 @@ export class UserService {
54 return this.authHttp.get(url) 53 return this.authHttp.get(url)
55 .catch(res => this.restExtractor.handleError(res)) 54 .catch(res => this.restExtractor.handleError(res))
56 } 55 }
56
57 askResetPassword (email: string) {
58 const url = UserService.BASE_USERS_URL + '/ask-reset-password'
59
60 return this.authHttp.post(url, { email })
61 .map(this.restExtractor.extractDataBool)
62 .catch(res => this.restExtractor.handleError(res))
63 }
64
65 resetPassword (userId: number, verificationString: string, password: string) {
66 const url = `${UserService.BASE_USERS_URL}/${userId}/reset-password`
67 const body = {
68 verificationString,
69 password
70 }
71
72 return this.authHttp.post(url, body)
73 .map(this.restExtractor.extractDataBool)
74 .catch(res => this.restExtractor.handleError(res))
75 }
57} 76}