core&ui: new domain_join logic

This commit is contained in:
undefined committed 2025-03-20 17:55:10 +00:00
1 parent 706a9a0928
commit 7fd01715bc
9 files changed
+81 -39

No files matched your search

+8
View File
@@ -212,6 +212,14 @@ export async function apply(ctx: Context) {
redirect: (this.context.originalPath || this.request.path) + this.context.search,
},
});
} else if (!this.user._dudoc.join && error instanceof PermissionError) {
this.response.redirect = this.url('domain_join', {
domainId: 'system',
query: {
redirect: (this.context.originalPath || this.request.path) + this.context.search,
target: this.domain._id,
},
});
} else {
this.response.status = error instanceof UserFacingError ? error.code : 500;
this.response.template = error instanceof UserFacingError ? 'error.html' : 'bsod.html';