(ctx context.Context, auth *coreauth.Auth)
| 356 | } |
| 357 | |
| 358 | func (h *Host) upsertAuthRecord(ctx context.Context, auth *coreauth.Auth) error { |
| 359 | manager := h.currentAuthManager() |
| 360 | if manager == nil || auth == nil { |
| 361 | return nil |
| 362 | } |
| 363 | if existing, ok := manager.GetByID(auth.ID); ok { |
| 364 | auth.CreatedAt = existing.CreatedAt |
| 365 | _, errUpdate := manager.Update(ctx, auth) |
| 366 | return errUpdate |
| 367 | } |
| 368 | _, errRegister := manager.Register(ctx, auth) |
| 369 | return errRegister |
| 370 | } |
| 371 | |
| 372 | func isUnsafeAuthFileName(name string) bool { |
| 373 | if strings.TrimSpace(name) == "" { |
no test coverage detected