fix: fix: disinto init change-password triggers must_change_password despite --must-change-password=false (#267)
This commit is contained in:
parent
f04a57e6db
commit
20de8e5d3a
1 changed files with 9 additions and 5 deletions
14
bin/disinto
14
bin/disinto
|
|
@ -708,11 +708,15 @@ setup_forge() {
|
|||
fi
|
||||
else
|
||||
echo "Admin user: ${admin_user} (already exists)"
|
||||
# Reset password to the persisted value so basic-auth works (#158)
|
||||
_forgejo_exec forgejo admin user change-password \
|
||||
--username "${admin_user}" \
|
||||
--password "${admin_pass}" \
|
||||
--must-change-password=false
|
||||
# Only reset password if basic auth fails (#158, #267)
|
||||
# Forgejo 11.x may ignore --must-change-password=false, blocking token creation
|
||||
if ! curl -sf --max-time 5 -u "${admin_user}:${admin_pass}" \
|
||||
"${forge_url}/api/v1/user" >/dev/null 2>&1; then
|
||||
_forgejo_exec forgejo admin user change-password \
|
||||
--username "${admin_user}" \
|
||||
--password "${admin_pass}" \
|
||||
--must-change-password=false
|
||||
fi
|
||||
fi
|
||||
# Preserve password for Woodpecker OAuth2 token generation (#779)
|
||||
_FORGE_ADMIN_PASS="$admin_pass"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue