Skip to content

Commit d9f2c18

Browse files
MOB-1679 #comment documented pin auth
1 parent 1e403d7 commit d9f2c18

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,41 @@ Transmit Security, https://github.com/TransmitSecurity
275275
## License
276276

277277
This project is licensed under the MIT license. See the LICENSE file for more info.
278+
279+
### Register PIN Code
280+
```js
281+
onRegisterPINCode = async (username: string, pinCode: string): Promise<void> => {
282+
try {
283+
const result = await TSAuthenticationSDKModule.registerPinCode(username, pinCode);
284+
// use result.contextIdentifier to commit the registration
285+
await TSAuthenticationSDKModule.commitPinRegistration(result.contextIdentifier);
286+
// Optionally, update your local user store or UI here
287+
} catch (error) {
288+
console.error(`Error registering PIN code: ${error}`);
289+
}
290+
}
291+
```
292+
293+
### Commit PIN Registration
294+
```js
295+
commitPinRegistration = async (contextIdentifier: string): Promise<void> => {
296+
try {
297+
await TSAuthenticationSDKModule.commitPinRegistration(contextIdentifier);
298+
// PIN registration is now committed
299+
} catch (error) {
300+
console.error(`Error committing PIN registration: ${error}`);
301+
}
302+
}
303+
```
304+
305+
### Authenticate with PIN Code
306+
```js
307+
authenticatePinCode = async (username: string, pinCode: string): Promise<void> => {
308+
try {
309+
const result = await TSAuthenticationSDKModule.authenticatePinCode(username, pinCode);
310+
// use the result string to complete PIN authentication in your backend.
311+
} catch (error) {
312+
console.error(`Error authenticating with PIN code: ${error}`);
313+
}
314+
}
315+
```

0 commit comments

Comments
 (0)