use the global constant for accounts.
Dieser Commit ist enthalten in:
Ursprung
2c798d6006
Commit
9817b81b92
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/phuslu/log"
|
||||
"go.sebtobie.de/httpserver"
|
||||
"go.sebtobie.de/httpserver/auth"
|
||||
)
|
||||
|
||||
|
@ -39,7 +40,7 @@ func LogMiddleware(c *gin.Context) {
|
|||
|
||||
// RequireUser is an middleware that looks if the user is an Anonymous user and redircts it to the login if so.
|
||||
func RequireUser(c *gin.Context) {
|
||||
var acc = c.MustGet("account").(auth.Account)
|
||||
var acc = c.MustGet(httpserver.Accounts).(auth.Account)
|
||||
if acc.Anonymous() {
|
||||
acc.Redirect(c)
|
||||
return
|
||||
|
|
Laden…
In neuem Issue referenzieren