mirror of
https://github.com/h44z/wg-portal.git
synced 2026-11-20 20:53:40 +01:00
feat(auth): require changing default admin password (#778)
This commit is contained in:
@@ -31,6 +31,8 @@ type UserManager interface {
|
||||
RegisterUser(ctx context.Context, user *domain.User) error
|
||||
// UpdateUserInternal updates an existing user in the database.
|
||||
UpdateUserInternal(ctx context.Context, user *domain.User) (*domain.User, error)
|
||||
// IsDefaultPasswordInUse checks if the default admin password is still in use.
|
||||
IsDefaultPasswordInUse(ctx context.Context) bool
|
||||
}
|
||||
|
||||
type EventBus interface {
|
||||
@@ -135,6 +137,11 @@ func NewAuthenticator(cfg *config.Auth, extUrl, basePath string, bus EventBus, u
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// IsDefaultPasswordInUse checks if the default admin password is still in use.
|
||||
func (a *Authenticator) IsDefaultPasswordInUse(ctx context.Context) bool {
|
||||
return a.users.IsDefaultPasswordInUse(ctx)
|
||||
}
|
||||
|
||||
// StartBackgroundJobs starts the background jobs for the authenticator.
|
||||
// It sets up the external authentication providers (OIDC, OAuth, LDAP) and retries in case of errors.
|
||||
func (a *Authenticator) StartBackgroundJobs(ctx context.Context) {
|
||||
|
||||
Reference in New Issue
Block a user