()
| 274 | |
| 275 | class DomainJoinApplicationsHandler extends ManageHandler { |
| 276 | async get() { |
| 277 | const r = await domain.getRoles(this.domain); |
| 278 | const roles = r.map((role) => role._id).sort(); |
| 279 | this.response.body.rolesWithText = roles.filter((i) => i !== 'guest').map((role) => [role, role]); |
| 280 | this.response.body.joinSettings = domain.getJoinSettings(this.domain, roles); |
| 281 | this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE }; |
| 282 | if (!this.response.body.joinSettings) { |
| 283 | delete this.response.body.expirations[domain.JOIN_EXPIRATION_KEEP_CURRENT]; |
| 284 | } |
| 285 | this.response.body.url_prefix = (this.domain.host || [])[0] || system.get('server.url'); |
| 286 | if (!this.response.body.url_prefix.endsWith('/')) this.response.body.url_prefix += '/'; |
| 287 | this.response.template = 'domain_join_applications.html'; |
| 288 | } |
| 289 | |
| 290 | @requireSudo |
| 291 | @post('method', Types.Range([domain.JOIN_METHOD_NONE, domain.JOIN_METHOD_ALL, domain.JOIN_METHOD_CODE])) |
nothing calls this directly
no test coverage detected