0.0.8 • Published 1 year ago

@prismicio/auth-context v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year 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

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago