MCPcopy Create free account
hub / github.com/alephdata/aleph / create_code

Function create_code

aleph/views/roles_api.py:82–115  ·  view source on GitHub ↗

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:

()

Source from the content-addressed store, hash-verified

80
81@blueprint.route("/api/2/roles/code", methods=["POST"])
82def 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"])

Callers

nothing calls this directly

Calls 5

requireFunction · 0.90
parse_requestFunction · 0.90
challenge_roleFunction · 0.90
jsonifyFunction · 0.90
can_registerMethod · 0.80

Tested by

no test coverage detected