0.0.8 • Published 2 years ago

@prismicio/auth-context v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

auth-context

Validate Prismic Context.

Example

import { decodeContext } from "@prismicio/auth-context";

const token = "user-or-wroom-or-m2m-token-string";

async function main() {
	const res = await fetch(`https://auth.wroom.io/validate?token=${token}`);
	const body = await res.json();

	const decodedContext = decodeContext(body);

	if (decodedContext.isValid) {
		console.log(decodedContext.decoded);
	} else {
		console.error(decodedContext.error);
	}
}

main();
0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago