support GitHub OAuth 2.0 authentication

This commit is contained in:
MaysWind
2025-10-22 22:18:04 +08:00
parent 81a5585029
commit 4b35103e34
7 changed files with 184 additions and 4 deletions
+3 -1
View File
@@ -6,12 +6,14 @@ type UserExternalAuthType string
// User External Auth Type
const (
USER_EXTERNAL_AUTH_TYPE_OAUTH2_NEXTCLOUD UserExternalAuthType = "nextcloud"
USER_EXTERNAL_AUTH_TYPE_OAUTH2_GITHUB UserExternalAuthType = "github"
)
// IsValid checks if the UserExternalAuthType is valid
func (t UserExternalAuthType) IsValid() bool {
switch t {
case USER_EXTERNAL_AUTH_TYPE_OAUTH2_NEXTCLOUD:
case USER_EXTERNAL_AUTH_TYPE_OAUTH2_NEXTCLOUD,
USER_EXTERNAL_AUTH_TYPE_OAUTH2_GITHUB:
return true
}
return false