mirror of
https://github.com/outline/outline.git
synced 2026-11-28 16:19:46 +03:00
fix: Avoid logging error when team not found in apex auth redirect (#12478)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
64ccdca0d7
commit
2c3e736eb3
1 file changed
+4
-1
@@ -39,9 +39,12 @@ export default function apexAuthRedirect<T>({
|
||||
try {
|
||||
const team = await Team.findByPk(teamId, {
|
||||
attributes: ["id", "domain", "subdomain"],
|
||||
rejectOnEmpty: true,
|
||||
});
|
||||
|
||||
if (!team) {
|
||||
return ctx.redirect(getErrorPath(ctx));
|
||||
}
|
||||
|
||||
return parseDomain(ctx.host).teamSubdomain === team.subdomain
|
||||
? ctx.redirect("/")
|
||||
: ctx.redirectOnClient(getRedirectPath(ctx, team));
|
||||
|
||||
Reference in new issue
Block a user