fix: align admin behavior and Kratos integrations
This commit is contained in:
@@ -17,21 +17,22 @@ import (
|
||||
)
|
||||
|
||||
type emailRepo struct {
|
||||
config *conf.AdminBackend
|
||||
runtime *conf.Runtime
|
||||
}
|
||||
|
||||
func NewEmailRepo(config *conf.AdminBackend) biz.EmailRepo {
|
||||
if config == nil {
|
||||
return &emailRepo{}
|
||||
}
|
||||
return &emailRepo{config: config}
|
||||
func NewEmailRepo(runtime *conf.Runtime) biz.EmailRepo {
|
||||
return &emailRepo{runtime: runtime}
|
||||
}
|
||||
|
||||
func (r *emailRepo) email() *conf.AdminBackend_Email {
|
||||
if r.config == nil {
|
||||
if r.runtime == nil {
|
||||
return nil
|
||||
}
|
||||
return r.config.Email
|
||||
config := r.runtime.Admin()
|
||||
if config == nil {
|
||||
return nil
|
||||
}
|
||||
return config.Email
|
||||
}
|
||||
|
||||
func (r *emailRepo) Enabled() bool {
|
||||
|
||||
Reference in New Issue
Block a user