Compare commits
4 Commits
v0.2.4
...
feat/updat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b4b0280e3 | ||
|
|
cc4a09914c | ||
|
|
09e2df708a | ||
|
|
a81594124e |
@@ -1,18 +0,0 @@
|
|||||||
import type { NextRequest } from "next/server";
|
|
||||||
import { NextResponse } from "next/server";
|
|
||||||
import { env } from "next-runtime-env";
|
|
||||||
|
|
||||||
export function middleware(request: NextRequest) {
|
|
||||||
if (request.nextUrl.pathname === "/") {
|
|
||||||
if (env("NEXT_PUBLIC_KAN_ENV") !== "cloud") {
|
|
||||||
const loginUrl = new URL("/login", request.url);
|
|
||||||
return NextResponse.redirect(loginUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NextResponse.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
matcher: ["/"],
|
|
||||||
};
|
|
||||||
@@ -83,18 +83,11 @@ export const memberRouter = createTRPCRouter({
|
|||||||
callbackURL: `/boards?type=invite&memberPublicId=${invite.publicId}`,
|
callbackURL: `/boards?type=invite&memberPublicId=${invite.publicId}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (error) {
|
if (error)
|
||||||
console.error("Failed to send magic link invitation:", {
|
|
||||||
email: input.email,
|
|
||||||
callbackURL: `/boards?type=invite&memberPublicId=${invite.publicId}`,
|
|
||||||
error,
|
|
||||||
});
|
|
||||||
|
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
message: `Failed to send magic link invitation to user with email ${input.email}.`,
|
message: `Failed to send magic link to user with email ${input.email}`,
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return invite;
|
return invite;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user