Send a account creation token to an email address. --- post: summary: Begin account registration description: > Begin validating a user email by sending a token to the address which can then be used to create an account. requestBody: content:
()
| 80 | |
| 81 | @blueprint.route("/api/2/roles/code", methods=["POST"]) |
| 82 | def create_code(): |
| 83 | """Send a account creation token to an email address. |
| 84 | --- |
| 85 | post: |
| 86 | summary: Begin account registration |
| 87 | description: > |
| 88 | Begin validating a user email by sending a token to the address |
| 89 | which can then be used to create an account. |
| 90 | requestBody: |
| 91 | content: |
| 92 | application/json: |
| 93 | schema: |
| 94 | $ref: '#/components/schemas/RoleCodeCreate' |
| 95 | responses: |
| 96 | '200': |
| 97 | description: OK |
| 98 | content: |
| 99 | application/json: |
| 100 | schema: |
| 101 | type: object |
| 102 | properties: |
| 103 | status: |
| 104 | type: string |
| 105 | token: |
| 106 | type: string |
| 107 | tags: |
| 108 | - Role |
| 109 | """ |
| 110 | require(request.authz.can_register()) |
| 111 | data = parse_request("RoleCodeCreate") |
| 112 | challenge_role(data) |
| 113 | return jsonify( |
| 114 | {"status": "ok", "message": gettext("To proceed, please check your email.")} |
| 115 | ) |
| 116 | |
| 117 | |
| 118 | @blueprint.route("/api/2/roles", methods=["POST"]) |
nothing calls this directly
no test coverage detected