Skip to content

feat(nextjs): add optional argument to fetch a new cts when getCtsToken#63

Merged
calvinbrewer merged 2 commits intomainfrom
trpc-1
Jan 27, 2025
Merged

feat(nextjs): add optional argument to fetch a new cts when getCtsToken#63
calvinbrewer merged 2 commits intomainfrom
trpc-1

Conversation

@calvinbrewer
Copy link
Contributor

getCtsToken previously took no arguments are relied on the Cipherstash session cookie to be set. Now if you optionally provide a user JWT to getCtsToken and the cookie doesn't exist, then a new CTS token will be fetched a returned at run time.

Before:

const ctsToken = getCtsToken()

After (pseudo code):

const { getToken } = auth()
const userJwt = await getToken()

const ctsToken = getCtsToken(userJwt)

@calvinbrewer calvinbrewer merged commit 4ed8134 into main Jan 27, 2025
1 check passed
@calvinbrewer calvinbrewer deleted the trpc-1 branch January 27, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant