UNPKG

@othent/kms-unbundled

Version:

Arweave Oauth Othent wallets enabled Google Key Management Service.

21 lines 714 B
import { login } from "../auth/login"; import { createUser } from "../operations/createUser"; import { getJWT } from "../auth/getJWT"; import { userDetails } from "../auth/userDetails"; /** * Connect the users account, this is the same as login/signup in one function. * @returns The the users details. */ export async function connect() { const user = await login(); if (user.authSystem === "KMS" && user.owner && user.walletAddress) { return user; } else { await createUser(); const userDetailsJWT = await getJWT(); localStorage.setItem("id_token", JSON.stringify(userDetailsJWT)); return await userDetails(); } } //# sourceMappingURL=connect.js.map