@@ -12,16 +12,18 @@ Once initialized `AngularTokenService` offers methods for session management:
12
12
13
13
## .signIn()
14
14
The signIn method is used to sign in the user with login (e.g. email address) and password.
15
- The optional parameter ` type ` specifies the name of UserType used for this session.
15
+ The optional parameter ` userType ` specifies the name of UserType used for this session.
16
16
17
- ` signIn({login: string, password: string, userType?: string}): Observable<Response> `
17
+ The optional parameter ` additionalData ` allows to pass custom data for the login logic (Example use case: Recaptcha).
18
+
19
+ ` signIn({login: string, password: string, userType?: string}, additionalData?: any): Observable<Response> `
18
20
19
21
#### Example:
20
22
``` javascript
21
23
this .tokenService .signIn ({
22
-
23
- password: ' secretPassword'
24
- } ).subscribe (
24
+
25
+ password: ' secretPassword' ,
26
+ }, additionalData ).subscribe (
25
27
res => console .log (res),
26
28
error => console .log (error)
27
29
);
@@ -43,15 +45,17 @@ this.tokenService.signOut().subscribe(
43
45
## .registerAccount()
44
46
Sends a new user registration request to the Server.
45
47
46
- ` registerAccount({login: string, password: string, passwordConfirmation: string, userType?: string}): Observable<Response> `
48
+ The optional parameter ` additionalData ` allows to pass custom data for the registration logic (Example use case: Recaptcha).
49
+
50
+ ` registerAccount({login: string, password: string, passwordConfirmation: string, userType?: string}, additionalData?: any): Observable<Response> `
47
51
48
52
#### Example:
49
53
``` javascript
50
54
this .tokenService .registerAccount ({
51
55
52
56
password: ' secretPassword' ,
53
57
passwordConfirmation: ' secretPassword'
54
- }).subscribe (
58
+ }, additionalData ).subscribe (
55
59
res => console .log (res),
56
60
error => console .log (error)
57
61
);
@@ -137,13 +141,13 @@ end
137
141
```
138
142
********
139
143
140
- ` resetPassword({login: string, userType?: string}): Observable<Response> `
144
+ ` resetPassword({login: string, userType?: string}, additionalData?: any ): Observable<Response> `
141
145
142
146
#### Example:
143
147
``` javascript
144
148
this .tokenService .resetPassword ({
145
149
146
- }).subscribe (
150
+ }, additionalData ).subscribe (
147
151
res => console .log (res),
148
152
error => console .log (error)
149
153
);
0 commit comments