forked from kevadesu/forgejo
[F3] promote F3 users to matching OAuth2 users on first sign-in
(cherry picked from commit bd7fef7496
)
This commit is contained in:
parent
aa43c6a71a
commit
07412698e8
6 changed files with 261 additions and 13 deletions
|
@ -33,6 +33,9 @@ const (
|
|||
SSPI // 7
|
||||
)
|
||||
|
||||
// This should be in the above list of types but is separated to avoid conflicts with Gitea changes
|
||||
const F3 Type = 129
|
||||
|
||||
// String returns the string name of the LoginType
|
||||
func (typ Type) String() string {
|
||||
return Names[typ]
|
||||
|
@ -51,6 +54,7 @@ var Names = map[Type]string{
|
|||
PAM: "PAM",
|
||||
OAuth2: "OAuth2",
|
||||
SSPI: "SPNEGO with SSPI",
|
||||
F3: "F3",
|
||||
}
|
||||
|
||||
// Config represents login config as far as the db is concerned
|
||||
|
@ -179,6 +183,10 @@ func (source *Source) IsSSPI() bool {
|
|||
return source.Type == SSPI
|
||||
}
|
||||
|
||||
func (source *Source) IsF3() bool {
|
||||
return source.Type == F3
|
||||
}
|
||||
|
||||
// HasTLS returns true of this source supports TLS.
|
||||
func (source *Source) HasTLS() bool {
|
||||
hasTLSer, ok := source.Cfg.(HasTLSer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue