mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: login 2fa
This commit is contained in:
parent
8d8ba150ef
commit
5abd9b75bb
33 changed files with 1063 additions and 122 deletions
|
@ -3,6 +3,7 @@ package api
|
|||
import (
|
||||
"errors"
|
||||
"github.com/0xJacky/Nginx-UI/internal/logger"
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"net/http"
|
||||
|
@ -11,6 +12,10 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func CurrentUser(c *gin.Context) *model.Auth {
|
||||
return c.MustGet("user").(*model.Auth)
|
||||
}
|
||||
|
||||
func ErrHandler(c *gin.Context, err error) {
|
||||
logger.GetLogger().Errorln(err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue