Commit 7ad15a4
fix: Heroku deployment issues - OAuth provider discovery and UserPreference migration (#122)
* fix(config): use dynamic OAuth provider discovery from environment variables
The overrideOAuthProviders function was only looking for providers that
already existed in the config map with hardcoded names (google, github,
microsoft). When no YAML config file was loaded (as on Heroku), the
providers map was empty and no providers would be discovered.
This change makes overrideOAuthProviders work like overrideSAMLProviders
by using envutil.DiscoverProviders to dynamically find all OAuth
providers from environment variables matching the pattern
OAUTH_PROVIDERS_<ID>_ENABLED.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(api): add UserPreference model to GetAllModels() for migrations
The GetAllModels() function in api/store.go was missing the
UserPreference model, which caused the user_preferences table
to not be created during GORM AutoMigrate on server startup.
This aligns GetAllModels() with AllModels() in api/models/models.go
which has all 25 models including UserPreference.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(test): add return after t.Fatal to satisfy staticcheck SA5011
Staticcheck SA5011 warns about possible nil pointer dereference even
after t.Fatal() because it doesn't understand that t.Fatal terminates
execution. Adding explicit return statements after t.Fatal() makes the
control flow clear to the linter.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 93f28e4 commit 7ad15a4
File tree
5 files changed
+64
-35
lines changed- api
- internal/config
5 files changed
+64
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
448 | 451 | | |
449 | | - | |
| 452 | + | |
| 453 | + | |
450 | 454 | | |
451 | 455 | | |
452 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
453 | 459 | | |
454 | | - | |
455 | | - | |
456 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
457 | 467 | | |
458 | 468 | | |
459 | 469 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
480 | 482 | | |
481 | | - | |
482 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
483 | 490 | | |
484 | | - | |
485 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
486 | 506 | | |
487 | | - | |
488 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
489 | 511 | | |
490 | 512 | | |
491 | | - | |
492 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
493 | 518 | | |
494 | 519 | | |
| 520 | + | |
495 | 521 | | |
496 | 522 | | |
497 | 523 | | |
| |||
0 commit comments