Remove AppContext struct and update JWT secret validation error message
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
package internal
|
|
||||||
|
|
||||||
import (
|
|
||||||
"CatsOfMastodonBotGo/internal/auth"
|
|
||||||
"CatsOfMastodonBotGo/internal/services"
|
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
type AppContext struct {
|
|
||||||
Db *gorm.DB
|
|
||||||
PostService *services.PostService
|
|
||||||
Jwt *auth.JwtTokenGenerator
|
|
||||||
AdminPassword string
|
|
||||||
Instance string
|
|
||||||
Tag string
|
|
||||||
}
|
|
@@ -42,7 +42,7 @@ func Load() *config {
|
|||||||
// Jwt params
|
// Jwt params
|
||||||
secret := os.Getenv("CAOM_JWT_SECRET")
|
secret := os.Getenv("CAOM_JWT_SECRET")
|
||||||
if secret == "" {
|
if secret == "" {
|
||||||
log.Fatal("No jwt secret provided, using default secret 'secret'")
|
log.Fatal("No jwt secret provided")
|
||||||
}
|
}
|
||||||
issuer := os.Getenv("CAOM_JWT_ISSUER")
|
issuer := os.Getenv("CAOM_JWT_ISSUER")
|
||||||
if issuer == "" {
|
if issuer == "" {
|
||||||
|
Reference in New Issue
Block a user