25 lines
408 B
Go
25 lines
408 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
type SignReq struct {
|
|
Email string `json:"email"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
func Sign(c *gin.Context) {
|
|
var req SignReq
|
|
if err := c.ShouldBindJSON(&req); err != nil {
|
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
|
}
|
|
jwt.
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"data": "hello world",
|
|
})
|
|
log.Println(req)
|
|
}
|