Skip to content

Commit 5aeb5ca

Browse files
authored
Merge pull request #60 from cipherstash/next-docs
docs: next docs for getCtsToken
2 parents cf7b8c0 + 1a30581 commit 5aeb5ca

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ import { getCtsToken } from '@cipherstash/nextjs'
241241
export default async function Page() {
242242
const ctsToken = await getCtsToken()
243243

244+
// getCtsToken returns either
245+
// ---
246+
// { success: true, ctsToken: CtsToken }
247+
// or
248+
// { success: false, error: string }
249+
250+
if (!ctsToken.success) {
251+
// handle error
252+
}
253+
244254
return (
245255
<div>
246256
<h1>Server side rendered page</h1>
@@ -259,6 +269,11 @@ import { getCtsToken } from '@cipherstash/nextjs'
259269

260270
export default async function Page() {
261271
const ctsToken = await getCtsToken()
272+
273+
if (!ctsToken.success) {
274+
// handle error
275+
}
276+
262277
const lockContext = new LockContext({
263278
ctsToken
264279
})

0 commit comments

Comments
 (0)