Browse Source

Fix: option name from allow_logout to allow_disconnect

pull/317/head
prichier 3 years ago
parent
commit
724ab34006
4 changed files with 8 additions and 8 deletions
  1. +1
    -1
      account.go
  2. +1
    -1
      config/config.go
  3. +5
    -5
      database.go
  4. +1
    -1
      templates/user/settings.tmpl

+ 1
- 1
account.go View File

@@ -1066,7 +1066,7 @@ func viewSettings(app *App, u *User, w http.ResponseWriter, r *http.Request) err
enableOauthGitLab = false
case "generic":
oauthAccounts[idx].DisplayName = app.Config().GenericOauth.DisplayName
oauthAccounts[idx].AllowLogout = app.Config().GenericOauth.AllowLogout
oauthAccounts[idx].AllowDisconnect = app.Config().GenericOauth.AllowDisconnect
enableOauthGeneric = false
}
}


+ 1
- 1
config/config.go View File

@@ -96,7 +96,7 @@ type (
TokenEndpoint string `ini:"token_endpoint"`
InspectEndpoint string `ini:"inspect_endpoint"`
AuthEndpoint string `ini:"auth_endpoint"`
AllowLogout bool `ini:"allow_logout"`
AllowDisconnect bool `ini:"allow_disconnect"`
}

// AppCfg holds values that affect how the application functions


+ 5
- 5
database.go View File

@@ -2588,11 +2588,11 @@ func (db *datastore) GetIDForRemoteUser(ctx context.Context, remoteUserID, provi
}

type oauthAccountInfo struct {
Provider string
ClientID string
RemoteUserID string
DisplayName string
AllowLogout bool
Provider string
ClientID string
RemoteUserID string
DisplayName string
AllowDisconnect bool
}

func (db *datastore) GetOauthAccounts(ctx context.Context, userID int64) ([]oauthAccountInfo, error) {


+ 1
- 1
templates/user/settings.tmpl View File

@@ -87,7 +87,7 @@ h3 { font-weight: normal; }
<input type="hidden" name="remote_user_id" value="{{ $oauth_account.RemoteUserID }}" />
<div class="section oauth-provider">
{{ if $oauth_account.DisplayName}}
{{ if $oauth_account.AllowLogout}}
{{ if $oauth_account.AllowDisconnect}}
<input type="submit" value="Remove {{.DisplayName}}" />
{{else}}
<a class="btn cta"><strong>{{.DisplayName}}</strong></a>


Loading…
Cancel
Save