feat: add support for custom error messages in auth middleware

This commit is contained in:
yanghao05
2025-04-29 16:35:40 +08:00
parent cfdf4fa461
commit d9a40dc636
2 changed files with 11 additions and 1 deletions

View File

@@ -51,3 +51,13 @@ jobs:
run: |
docker login -u ${{ secrets.DOCKER_AF_USERNAME }} -p ${{ secrets.DOCKER_AF_PASSWORD }} docker-af.hub.ipao.vip
docker build -f Dockerfile --push -t docker-af.hub.ipao.vip/rogeecn/quyun:latest .
- name: Send Message To Gotify
run: |
curl -X POST "https://gotify.jdwan.com/message?token=${{ secrets.GOTIFY_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"title": "GITEA Build: quyun ",
"message": "quyun Build Success",
"priority": 5
}'

View File

@@ -54,7 +54,7 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
return ctx.Redirect().To(fullUrl)
}
user, err = models.Users.GetByID(ctx.Context(), jwt.UserID)
user, err := models.Users.GetByID(ctx.Context(), jwt.UserID)
if err != nil {
// remove cookie
ctx.ClearCookie("token")