feat: complete registration invitation and auth redesign
This commit is contained in:
+3
-3
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user