|
|
|
@ -23,6 +23,7 @@ type Handler struct { |
|
|
|
store store.Store |
|
|
|
engine *gin.Engine |
|
|
|
oAuthConf *oauth2.Config |
|
|
|
DoNotCheckConfigViaGet bool // DoNotCheckConfigViaGet is for the unit testing usage
|
|
|
|
} |
|
|
|
|
|
|
|
// New initializes the http handlers
|
|
|
|
@ -56,6 +57,7 @@ func (h *Handler) setTemplateFromFS(name string) error { |
|
|
|
} |
|
|
|
|
|
|
|
func (h *Handler) checkIfSecretExist() error { |
|
|
|
if h.DoNotCheckConfigViaGet { |
|
|
|
conf := config.Get() |
|
|
|
if conf.Handlers.Secret == nil { |
|
|
|
b := make([]byte, 128) |
|
|
|
@ -67,6 +69,7 @@ func (h *Handler) checkIfSecretExist() error { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
|