@@ -133,7 +133,6 @@ func authenticate(store *datastore.Datastore, fn http.HandlerFunc, authMethod st
133
133
// logrus.Info("2", redirectURL)
134
134
}
135
135
136
- logrus .Info ("3" , redirectURL )
137
136
http .Redirect (w , req , redirectURL , http .StatusMovedPermanently )
138
137
return
139
138
}
@@ -143,24 +142,30 @@ func authenticate(store *datastore.Datastore, fn http.HandlerFunc, authMethod st
143
142
// if store.Settings.CheckCSRFViaReferrer {
144
143
145
144
// }
145
+ logrus .Info ("xx" )
146
146
147
+ logrus .Info ("method" , authMethod )
147
148
if authMethod == security .NoAuth {
148
149
fn (w , req )
149
150
return
150
151
}
152
+ logrus .Info ("yy" )
151
153
152
154
tableName := "person" // default
153
155
api := bone .GetValue (req , "api" )
154
156
if api == "api" || api == "admin" {
155
157
// default - backwards compatibility
156
158
tableName = "person" // we already did this above, this is just for clarity. the default should ALWAYS BE person
157
- } else {
159
+ } else if api != "" {
158
160
tableName = api
159
161
}
160
162
161
163
// if we are at this point then we want a login
162
164
// check for a logged in user. We always check this incase we need it
163
- loggedInUser , _ := security .New (req , store ).LoggedInUser ()
165
+ loggedInUser , err := security .New (req , store ).LoggedInUser ()
166
+ if err != nil {
167
+ logrus .Error ("Something wrong with Auth" , err )
168
+ }
164
169
if loggedInUser != nil && loggedInUser .TableName == tableName { // we are in the correct section of the website
165
170
fn (w , req )
166
171
return
0 commit comments