Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

397 B
Raw Blame
"use server";

import { generateUnsubscribeToken } from "../email/unsubscribe-token";
import { authUserActionClient } from "./safe-action";

// Generate an unsubscribe token for a user
export const generateUnsubscribeTokenAction = authUserActionClient.action(
  async ({ ctx }) => {
    const { user } = ctx;

    const token = generateUnsubscribeToken(user.email);

    return { token };
  },
);