mirror of
https://github.com/sbondCo/Watcharr.git
synced 2026-08-07 07:14:44 +00:00
a61f0dbbf3
before sending to client
21 lines
476 B
Go
21 lines
476 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// Location middleware
|
|
func WhereaboutsRequired() gin.HandlerFunc {
|
|
// TODO: This should also take into account a user
|
|
// preference (of location.. which also needs to be
|
|
// added) and server preference (env var). The US is
|
|
// good enough for now as a default.
|
|
return func(c *gin.Context) {
|
|
slog.Debug("WhereaboutsRequired middleware hit", "country", "US")
|
|
c.Set("userCountry", "US")
|
|
c.Next()
|
|
}
|
|
}
|