fix(auth): make things work
This commit is contained in:
@@ -2,7 +2,11 @@ import { initTRPC } from "@trpc/server"
|
||||
|
||||
import { env } from "@/env/server"
|
||||
|
||||
import { badRequestError, unauthorizedError } from "./errors/trpc"
|
||||
import {
|
||||
badRequestError,
|
||||
sessionExpiredError,
|
||||
unauthorizedError,
|
||||
} from "./errors/trpc"
|
||||
import { transformer } from "./transformer"
|
||||
|
||||
import type { Meta } from "@/types/trpc/meta"
|
||||
@@ -35,7 +39,7 @@ export const protectedProcedure = t.procedure.use(async function (opts) {
|
||||
}
|
||||
|
||||
if (session?.error === "RefreshAccessTokenError") {
|
||||
throw unauthorizedError()
|
||||
throw sessionExpiredError()
|
||||
}
|
||||
|
||||
if (!session?.user) {
|
||||
|
||||
Reference in New Issue
Block a user