Merge pull request #4729 from dokku/user-auth-count-check

Correct count check for user-auth trigger
This commit is contained in:
Jose Diaz-Gonzalez
2021-08-07 18:44:38 -04:00
committed by GitHub

View File

@@ -795,8 +795,15 @@ dokku_auth() {
export SSH_USER=${SSH_USER:=$USER}
export SSH_NAME=${NAME:="default"}
local user_auth_count=$(find "$PLUGIN_PATH"/enabled/*/user-auth 2>/dev/null | wc -l)
# no plugin trigger exists
if [[ $user_auth_count == 0 ]]; then
return 0
fi
# this plugin trigger exists in the core `20_events` plugin
if [[ $(find "$PLUGIN_PATH"/enabled/*/user-auth 2>/dev/null | wc -l) == 1 ]]; then
if [[ "$user_auth_count" == 1 ]] && [[ -f "$PLUGIN_PATH"/enabled/20_events/user-auth ]]; then
return 0
fi