feat: complete registration invitation and auth redesign

This commit is contained in:
richjohnrambo
2026-08-19 00:30:11 +08:00
parent e063e7879e
commit 219ecadf4c
47 changed files with 9014 additions and 224 deletions
+3 -3
View File
@@ -321,17 +321,17 @@ func main() {
if userId.IsZero() {
log.Fatalf("Must specify a valid user ID '%s' to promote to ROOT", *makeRoot)
}
login, _, _, _, err := store.Users.GetAuthRecord(tenantID, userId, "basic")
login, _, _, _, err := store.Users.GetAuthRecord(tenantID, userId)
if err != nil {
log.Fatalln("Failed to read user authentication record", err)
}
tenantAdapter, ok := adapter.(interface {
TenantAuthUpdRecord(types.TenantID, types.Uid, string, string, auth.Level, []byte, time.Time) error
TenantAuthUpdateRecord(types.TenantID, types.Uid, string, auth.Level, []byte, time.Time) error
})
if !ok {
log.Fatalln("Configured adapter does not support tenant authentication")
}
if err = tenantAdapter.TenantAuthUpdRecord(tenantID, userId, "basic", "basic:"+login,
if err = tenantAdapter.TenantAuthUpdateRecord(tenantID, userId, login,
auth.LevelRoot, nil, time.Time{}); err != nil {
log.Fatalln("Failed to promote user to ROOT", err)
}