requireAuth()
Othent JS SDK requireAuth() function
API
requireAuth(): Promise<void>;Example usage
import { Othent } from "@othent/kms";
const othent = new Othent({ appInfo, throwErrors: false, ... });
// ...
const storeSecret = async (key: string, plaintext: string) => {
// Make sure the user is authenticated, or prompt them to authenticate:
await othent.requireAuth();
// Now we can call other functions from Othent:
const encryptedData = await othent.encrypt(plaintext);
localStorage.set(key, encryptedData);
}Last updated