mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 08:21:50 -06:00
36 lines
778 B
Go
36 lines
778 B
Go
package oauth
|
|
|
|
import (
|
|
"github.com/m1k1o/neko/server/pkg/types"
|
|
)
|
|
|
|
type Config struct {
|
|
Enabled bool
|
|
AutoRedirect bool
|
|
Name string
|
|
AdminEmails []string
|
|
UserEmails []string
|
|
ClientID string
|
|
ClientSecret string
|
|
IssuerURL string
|
|
AuthorizationURL string
|
|
TokenURL string
|
|
UserInfoURL string
|
|
RedirectURL string
|
|
Scopes []string
|
|
SubjectField string
|
|
UsernameField string
|
|
AvatarField string
|
|
SuccessRedirect string
|
|
AdminProfile types.MemberProfile
|
|
UserProfile types.MemberProfile
|
|
}
|
|
|
|
func (c *Config) IsConfigured() bool {
|
|
return c.Enabled && c.ClientID != "" &&
|
|
c.ClientSecret != "" &&
|
|
c.AuthorizationURL != "" &&
|
|
c.TokenURL != "" &&
|
|
c.UserInfoURL != ""
|
|
}
|