Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default account and password #150

Open
G-Akiraka opened this issue Jul 4, 2023 · 2 comments
Open

Default account and password #150

G-Akiraka opened this issue Jul 4, 2023 · 2 comments

Comments

@G-Akiraka
Copy link

The docker deployment is successful. By default, the account and password documents are not written

@G-Akiraka
Copy link
Author

admin/toughradius
talkincode/toughradius

All the above passwords failed

@jamiesun
Copy link
Contributor

jamiesun commented Jul 6, 2023

The program always detects the superuser when it starts, if you can't log in, please check if the database connection and initialization are correct.

func (a *Application) checkSuper() {
	var count int64
	a.gormDB.Model(&models.SysOpr{}).Where("username='admin' and level = ?", "super").Count(&count)
	if count == 0 {
		a.gormDB.Create(&models.SysOpr{
			ID:        common.UUIDint64(),
			Realname:  "administrator",
			Mobile:    "0000",
			Email:     "N/A",
			Username:  "admin",
			Password:  common.Sha256HashWithSalt("toughradius", common.SecretSalt),
			Level:     "super",
			Status:    "enabled",
			Remark:    "super",
			LastLogin: time.Now(),
		})
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants