@@ -4174,7 +4174,7 @@ func getPreLoginHookResponse(loginMethod, ip, protocol string, userAsJSON []byte
4174
4174
4175
4175
cmd := exec .CommandContext (ctx , config .PreLoginHook , args ... )
4176
4176
cmd .Env = append (env ,
4177
- fmt .Sprintf ("SFTPGO_LOGIND_USER=%s" , util . BytesToString ( userAsJSON ) ),
4177
+ fmt .Sprintf ("SFTPGO_LOGIND_USER=%s" , userAsJSON ),
4178
4178
fmt .Sprintf ("SFTPGO_LOGIND_METHOD=%s" , loginMethod ),
4179
4179
fmt .Sprintf ("SFTPGO_LOGIND_IP=%s" , ip ),
4180
4180
fmt .Sprintf ("SFTPGO_LOGIND_PROTOCOL=%s" , protocol ),
@@ -4221,7 +4221,7 @@ func executePreLoginHook(username, loginMethod, ip, protocol string, oidcTokenFi
4221
4221
recoveryCodes := u .Filters .RecoveryCodes
4222
4222
err = json .Unmarshal (out , & u )
4223
4223
if err != nil {
4224
- return u , fmt .Errorf ("invalid pre-login hook response %q, error: %v" , util . BytesToString ( out ) , err )
4224
+ return u , fmt .Errorf ("invalid pre-login hook response %q, error: %v" , out , err )
4225
4225
}
4226
4226
u .ID = userID
4227
4227
u .UsedQuotaSize = userUsedQuotaSize
@@ -4316,7 +4316,7 @@ func ExecutePostLoginHook(user *User, loginMethod, ip, protocol string, err erro
4316
4316
4317
4317
cmd := exec .CommandContext (ctx , config .PostLoginHook , args ... )
4318
4318
cmd .Env = append (env ,
4319
- fmt .Sprintf ("SFTPGO_LOGIND_USER=%s" , util . BytesToString ( userAsJSON ) ),
4319
+ fmt .Sprintf ("SFTPGO_LOGIND_USER=%s" , userAsJSON ),
4320
4320
fmt .Sprintf ("SFTPGO_LOGIND_IP=%s" , ip ),
4321
4321
fmt .Sprintf ("SFTPGO_LOGIND_METHOD=%s" , loginMethod ),
4322
4322
fmt .Sprintf ("SFTPGO_LOGIND_STATUS=%s" , status ),
@@ -4385,7 +4385,7 @@ func getExternalAuthResponse(username, password, pkey, keyboardInteractive, ip,
4385
4385
cmd := exec .CommandContext (ctx , config .ExternalAuthHook , args ... )
4386
4386
cmd .Env = append (env ,
4387
4387
fmt .Sprintf ("SFTPGO_AUTHD_USERNAME=%s" , username ),
4388
- fmt .Sprintf ("SFTPGO_AUTHD_USER=%s" , util . BytesToString ( userAsJSON ) ),
4388
+ fmt .Sprintf ("SFTPGO_AUTHD_USER=%s" , userAsJSON ),
4389
4389
fmt .Sprintf ("SFTPGO_AUTHD_IP=%s" , ip ),
4390
4390
fmt .Sprintf ("SFTPGO_AUTHD_PASSWORD=%s" , password ),
4391
4391
fmt .Sprintf ("SFTPGO_AUTHD_PUBLIC_KEY=%s" , pkey ),
0 commit comments