chore: OpenVPN user and password as nullable
- Username and password can be the empty string for custom provider
This commit is contained in:
3
internal/server/helpers.go
Normal file
3
internal/server/helpers.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package server
|
||||
|
||||
func stringPtr(s string) *string { return &s }
|
||||
@@ -94,8 +94,8 @@ func (h *openvpnHandler) setStatus(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *openvpnHandler) getSettings(w http.ResponseWriter) {
|
||||
vpnSettings := h.looper.GetSettings()
|
||||
settings := vpnSettings.OpenVPN
|
||||
settings.User = "redacted"
|
||||
settings.Password = "redacted"
|
||||
settings.User = stringPtr("redacted")
|
||||
settings.Password = stringPtr("redacted")
|
||||
encoder := json.NewEncoder(w)
|
||||
if err := encoder.Encode(settings); err != nil {
|
||||
h.warner.Warn(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user