mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #4729 from dokku/user-auth-count-check
Correct count check for user-auth trigger
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user