({ }, code: string)
| 294 | |
| 295 | @param('code', Types.String) |
| 296 | async prepare({ }, code: string) { |
| 297 | this.tdoc = await token.get(code, token.TYPE_REGISTRATION); |
| 298 | if (!this.tdoc?.identity) { |
| 299 | // prevent brute forcing tokens |
| 300 | await this.limitRate('user_register_with_code', 60, 5); |
| 301 | throw new InvalidTokenError(token.TYPE_TEXTS[token.TYPE_REGISTRATION], code); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | async get() { |
| 306 | this.response.template = 'user_register_with_code.html'; |