fix: check if session exists for see other
This commit is contained in:
parent
dd952a1f39
commit
ffd3890584
|
|
@ -29,6 +29,7 @@ func (res *Response) Write(w http.ResponseWriter, r *http.Request) error {
|
||||||
|
|
||||||
if res.SeeOther != "" {
|
if res.SeeOther != "" {
|
||||||
http.Redirect(w, r, res.SeeOther, http.StatusSeeOther)
|
http.Redirect(w, r, res.SeeOther, http.StatusSeeOther)
|
||||||
|
if res.Session != nil {
|
||||||
flash := res.Session.FlashPeek()
|
flash := res.Session.FlashPeek()
|
||||||
if flash != nil {
|
if flash != nil {
|
||||||
err := json.NewEncoder(w).Encode(flash)
|
err := json.NewEncoder(w).Encode(flash)
|
||||||
|
|
@ -36,6 +37,7 @@ func (res *Response) Write(w http.ResponseWriter, r *http.Request) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue