mirror of
https://git.freecumextremist.com/grumbulon/pomme.git
synced 2024-12-22 21:40:44 +00:00
small response stuff
This commit is contained in:
parent
f469d20e06
commit
11692efdd1
3 changed files with 5 additions and 6 deletions
|
@ -72,5 +72,5 @@ func Ingest(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func AuthTest(w http.ResponseWriter, r *http.Request) {
|
||||
_, claims, _ := jwtauth.FromContext(r.Context())
|
||||
w.Write([]byte(fmt.Sprintf("protected area. hi %v", claims["user_id"])))
|
||||
w.Write([]byte(fmt.Sprintf("protected area. hi %v", claims["username"])))
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ func Login(w http.ResponseWriter, r *http.Request) {
|
|||
internal.Response{
|
||||
Message: "Successfully logged in",
|
||||
HTTPResponse: 200,
|
||||
Username: token,
|
||||
})
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@ type Zone struct {
|
|||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Username string `json:"name"`
|
||||
Username string
|
||||
Password string
|
||||
HashedPassword string
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Username string `json:"username"`
|
||||
Message string `json:"message"`
|
||||
HTTPResponse int `json:"status"`
|
||||
Username string `json:"username,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
HTTPResponse int `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
func (zone *ZoneRequest) Parse() error {
|
||||
|
|
Loading…
Reference in a new issue