@@ -129,47 +129,58 @@ import { useCryptr } from `@cryptr/cryptr-react-native`
129
129
130
130
// ...
131
131
132
- const { /* */ } = useCryptr ()
132
+ const { /* Any required hook */ } = useCryptr ()
133
133
```
134
134
135
135
#### isAuthenticated
136
136
137
137
Hook to know if a Cryptr session is active
138
138
139
- The return type is a boolean
139
+ The return type is a < u > ** boolean** </ u >
140
140
141
141
``` js
142
142
const { isAuthenticated } = useCryptr ()
143
+
144
+ if (isAuthenticated) { /* */ }
143
145
```
144
146
145
147
#### user
146
148
147
149
Hook to retrieve the User information (extracted from current oAuth Cryptr active session ID Token)
148
150
149
- The return type is a key/value pair Object.
151
+ The return type is a < u > ** key/value pair Object.** </ u >
150
152
151
153
``` js
152
154
const { user } = useCryptr ()
155
+
156
+ // ...
157
+ user ()
153
158
```
154
159
155
160
#### accessToken
156
161
157
162
Hook to retrieve the current accessToken value
158
163
159
- The return type is a string.
164
+ The return type is a < u > ** nullable string** </ u > .
160
165
161
166
``` js
162
167
const { accessToken } = useCryptr ()
168
+
169
+ // ..
170
+ {accessToken && < Text > {accessToken}< / Text > }
163
171
```
164
172
165
173
#### idToken
166
174
167
175
Hook to retrieve the current idToken value
168
176
169
- The return type is a string.
177
+ The return type is a < u > ** string** </ u > .
170
178
171
179
``` js
172
180
const { idToken } = useCryptr ()
181
+
182
+ // ...
183
+ {idToken && < Text > {idToken}< / Text > }
173
184
```
174
185
175
186
--
@@ -182,9 +193,11 @@ Hook action to sign in the user using a specific SSO.
182
193
* Requires* ` idpId ` value.
183
194
184
195
185
-
186
196
``` js
187
197
const { signinWithSSO } = useCryptr ()
198
+
199
+ // [...]
200
+ signinWithSSO (idpID: string, successCallback?: (data : any ) => any, errorCallback?: (data : any ) => any)
188
201
```
189
202
190
203
#### refreshTokens
@@ -193,6 +206,9 @@ Hook action to refresh tokens to new ones.
193
206
194
207
``` js
195
208
const { refreshTokens } = useCryptr ()
209
+
210
+ // [...]
211
+ refreshTokens (callback?: (data : any ) => any)
196
212
```
197
213
198
214
#### logOut
@@ -202,6 +218,10 @@ Hook action to log out user.
202
218
203
219
``` js
204
220
const { logOut } = useCryptr ()
221
+
222
+ // [...]
223
+
224
+ logOut (successCallback?: (data : any ) => any, errorCallback?: (data : any ) => any)
205
225
```
206
226
207
227
--
@@ -220,7 +240,7 @@ const { error } = useCryptr()
220
240
221
241
Hook to inform you about that a Cryptr process is in progress.
222
242
223
- The return type is a boolean
243
+ The return type is a < u > ** boolean** </ u >
224
244
225
245
``` js
226
246
const { isLoading } = useCryptr ()
0 commit comments