chore: set guest while token is empty

This commit is contained in:
Noah Hsu
2022-06-26 16:39:02 +08:00
parent 54ca68e4b3
commit 7cbfe93a02
6 changed files with 31 additions and 8 deletions

View File

@ -22,6 +22,7 @@ func initUser() {
Password: random.RandomStr(8),
Role: model.ADMIN,
BasePath: "/",
Webdav: true,
}
if err := db.CreateUser(admin); err != nil {
panic(err)
@ -35,6 +36,9 @@ func initUser() {
if errors.Is(err, gorm.ErrRecordNotFound) {
guest = &model.User{
Username: "guest",
Password: "guest",
ReadOnly: true,
Webdav: true,
Role: model.GUEST,
BasePath: "/",
}