blob: baa67fbbcc32c36fe65367cb462ba3d64e36c127 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
package middleware
import (
"lain/utils/auth"
"lain/utils/shortcuts"
"github.com/gofiber/fiber/v2"
)
func authentication(context *fiber.Ctx) error {
if !auth.IsAuthenticated(context) {
return shortcuts.Redirect(context, "auth.login")
}
return context.Next()
}
|