mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: new domain_join logic
This commit is contained in:
1 parent
706a9a0928
commit
7fd01715bc
9 files changed
+81
-39
No files matched your search
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user