Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

279 B
Raw Blame
import { createHash } from "crypto";

export const hashToken = (
  token: string,
  {
    noSecret = false,
  }: {
    noSecret?: boolean;
  } = {},
) => {
  return createHash("sha256")
    .update(`${token}${noSecret ? "" : process.env.NEXTAUTH_SECRET}`)
    .digest("hex");
};