Checkin time data column, checkin module
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"nixcn-cms/data"
|
||||
"nixcn-cms/internal/crypto/jwt"
|
||||
"nixcn-cms/pkgs/magiclink"
|
||||
"nixcn-cms/pkgs/turnstile"
|
||||
|
||||
"github.com/google/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -68,8 +69,12 @@ func VerifyMagicLink(c *gin.Context) {
|
||||
}
|
||||
|
||||
// Generate jwt
|
||||
uuid, _ := uuid.NewUUID()
|
||||
jwtToken, _ := jwt.GenerateToken(uuid, "application")
|
||||
userInfo := new(data.User)
|
||||
err := userInfo.GetByEmail(email)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusUnauthorized, gin.H{"status": "user not found"})
|
||||
}
|
||||
jwtToken, _ := jwt.GenerateToken(userInfo.UserId, "application")
|
||||
|
||||
c.JSON(200, gin.H{
|
||||
"jwt_token": jwtToken,
|
||||
|
||||
Reference in New Issue
Block a user