mailu: store app password as list
This commit is contained in:
parent
26f11db285
commit
5f7ea4544d
@ -181,7 +181,7 @@ def main():
|
||||
|
||||
if not app_pw:
|
||||
app_pw = random_password()
|
||||
attrs["mailu_app_password"] = app_pw
|
||||
attrs["mailu_app_password"] = [app_pw]
|
||||
kc_update_attributes(token, user, attrs)
|
||||
log(f"Set mailu_app_password for {email}")
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ users=$(curl -s -H "Authorization: Bearer ${token}" \
|
||||
echo "${users}" | jq -c '.[]' | while read -r user; do
|
||||
username=$(echo "${user}" | jq -r '.username')
|
||||
email=$(echo "${user}" | jq -r '.email // empty')
|
||||
app_pw=$(echo "${user}" | jq -r '.attributes.mailu_app_password[0] // empty')
|
||||
app_pw=$(echo "${user}" | jq -r '(.attributes.mailu_app_password[0] // .attributes.mailu_app_password // empty)')
|
||||
[[ -z "${email}" || -z "${app_pw}" ]] && continue
|
||||
if account_exists "${username}" "${email}"; then
|
||||
echo "Skipping ${email}, already exists"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user