File tree 5 files changed +6
-14
lines changed
5 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,6 @@ func ActiveSources(tp Type) ([]*Source, error) {
275
275
// IsSSPIEnabled returns true if there is at least one activated login
276
276
// source of type LoginSSPI
277
277
func IsSSPIEnabled () bool {
278
- if ! db .HasEngine {
279
- return false
280
- }
281
278
sources , err := ActiveSources (SSPI )
282
279
if err != nil {
283
280
log .Error ("ActiveSources: %v" , err )
Original file line number Diff line number Diff line change 27
27
x * xorm.Engine
28
28
tables []any
29
29
initFuncs []func () error
30
-
31
- // HasEngine specifies if we have a xorm.Engine
32
- HasEngine bool
33
30
)
34
31
35
32
// Engine represents a xorm engine or session.
Original file line number Diff line number Diff line change @@ -343,8 +343,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
343
343
LandingPageURL = LandingPageOrganizations
344
344
case "login" :
345
345
LandingPageURL = LandingPageLogin
346
- case "" :
347
- case "home" :
346
+ case "" , "home" :
348
347
LandingPageURL = LandingPageHome
349
348
default :
350
349
LandingPageURL = LandingPage (landingPage )
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ func InitDBEngine(ctx context.Context) (err error) {
37
37
log .Info ("Backing off for %d seconds" , int64 (setting .Database .DBConnectBackoff / time .Second ))
38
38
time .Sleep (setting .Database .DBConnectBackoff )
39
39
}
40
- db .HasEngine = true
41
40
config .SetDynGetter (system_model .NewDatabaseDynKeyGetter ())
42
41
return nil
43
42
}
Original file line number Diff line number Diff line change @@ -45,10 +45,6 @@ const (
45
45
46
46
// AutoSignIn reads cookie and try to auto-login.
47
47
func AutoSignIn (ctx * context.Context ) (bool , error ) {
48
- if ! db .HasEngine {
49
- return false , nil
50
- }
51
-
52
48
uname := ctx .GetSiteCookie (setting .CookieUserName )
53
49
if len (uname ) == 0 {
54
50
return false , nil
@@ -130,7 +126,11 @@ func checkAutoLogin(ctx *context.Context) bool {
130
126
131
127
if isSucceed {
132
128
middleware .DeleteRedirectToCookie (ctx .Resp )
133
- ctx .RedirectToFirst (redirectTo , setting .AppSubURL + string (setting .LandingPageURL ))
129
+ nextRedirectTo := setting .AppSubURL + string (setting .LandingPageURL )
130
+ if setting .LandingPageURL == setting .LandingPageLogin {
131
+ nextRedirectTo = setting .AppSubURL + "/" // do not cycle-redirect to the login page
132
+ }
133
+ ctx .RedirectToFirst (redirectTo , nextRedirectTo )
134
134
return true
135
135
}
136
136
You can’t perform that action at this time.
0 commit comments