feat: add invited_by attribute
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cellarspoon 2022-01-10 09:40:16 +01:00
parent e347b1eed1
commit 3138a2964f
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
2 changed files with 5 additions and 0 deletions

View File

@ -58,7 +58,9 @@ def form_keycloak_register(
username: str = Form(...), username: str = Form(...),
email: str = Form(...), email: str = Form(...),
password: str = Form(...), password: str = Form(...),
invited_by: str = Form(...),
): ):
payload = { payload = {
"email": email, "email": email,
"username": username, "username": username,
@ -74,6 +76,7 @@ def form_keycloak_register(
"realmRoles": [ "realmRoles": [
"user_default", "user_default",
], ],
"attributes": {"invited_by": username},
} }
try: try:

View File

@ -20,6 +20,8 @@
<label for="password">Password:</label> <label for="password">Password:</label>
<input type="password" name="password" /> <input type="password" name="password" />
<input type="hidden" name="invited_by" value="{{ username }}"/>
<input type="submit" /> <input type="submit" />
</form> </form>