mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	fix plain oauth login (#317)
This commit is contained in:
		@@ -7,10 +7,9 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Auth struct {
 | 
			
		||||
	OpenIDConnect     []OpenIDConnectProvider `yaml:"oidc"`
 | 
			
		||||
	OAuth             []OAuthProvider         `yaml:"oauth"`
 | 
			
		||||
	Ldap              []LdapProvider          `yaml:"ldap"`
 | 
			
		||||
	CallbackUrlPrefix string                  `yaml:"callback_url_prefix"`
 | 
			
		||||
	OpenIDConnect []OpenIDConnectProvider `yaml:"oidc"`
 | 
			
		||||
	OAuth         []OAuthProvider         `yaml:"oauth"`
 | 
			
		||||
	Ldap          []LdapProvider          `yaml:"ldap"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type BaseFields struct {
 | 
			
		||||
@@ -24,7 +23,7 @@ type BaseFields struct {
 | 
			
		||||
 | 
			
		||||
type OauthFields struct {
 | 
			
		||||
	BaseFields `yaml:",inline"`
 | 
			
		||||
	IsAdmin    string `yaml:"is_admin"`
 | 
			
		||||
	IsAdmin    string `yaml:"is_admin"` // If the value is "true", the user is an admin.
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type LdapFields struct {
 | 
			
		||||
@@ -93,8 +92,6 @@ type OAuthProvider struct {
 | 
			
		||||
	// DisplayName is shown to the user on the login page. If it is empty, ProviderName will be displayed.
 | 
			
		||||
	DisplayName string `yaml:"display_name"`
 | 
			
		||||
 | 
			
		||||
	BaseUrl string `yaml:"base_url"`
 | 
			
		||||
 | 
			
		||||
	// ClientID is the application's ID.
 | 
			
		||||
	ClientID string `yaml:"client_id"`
 | 
			
		||||
 | 
			
		||||
@@ -105,10 +102,6 @@ type OAuthProvider struct {
 | 
			
		||||
	TokenURL    string `yaml:"token_url"`
 | 
			
		||||
	UserInfoURL string `yaml:"user_info_url"`
 | 
			
		||||
 | 
			
		||||
	// RedirectURL is the URL to redirect users going through
 | 
			
		||||
	// the OAuth flow, after the resource owner's URLs.
 | 
			
		||||
	RedirectURL string `yaml:"redirect_url"`
 | 
			
		||||
 | 
			
		||||
	// Scope specifies optional requested permissions.
 | 
			
		||||
	Scopes []string `yaml:"scopes"`
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -104,8 +104,6 @@ func defaultConfig() *Config {
 | 
			
		||||
		SiteCompanyName:   "WireGuard Portal",
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cfg.Auth.CallbackUrlPrefix = "/api/v0"
 | 
			
		||||
 | 
			
		||||
	cfg.Advanced.StartListenPort = 51820
 | 
			
		||||
	cfg.Advanced.StartCidrV4 = "10.11.12.0/24"
 | 
			
		||||
	cfg.Advanced.StartCidrV6 = "fdfd:d3ad:c0de:1234::0/64"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user