You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
When deploying and setting your environment to Development.
I could get to see any page of my website. Wherease in development it was working.
This can be workedaround by deleting your cookies from the users browser.
When switshing back to dev after, the same behaviour arise.
The following erro is thrown in console mode, which is maybe a little too generic to find the problem:
ERRO[2018-03-08T11:18:32+01:00] sql: no rows in result set content_type=text/html db="3.158217ms" duration="7.859285ms" human_size="0 B" method=GET path=/ request_id="0776e8d9b6-691af068f4" size="0" status="0"
Stan proposed a solution , that is not yet tested :
funcSetCurrentUser(next buffalo.Handler) buffalo.Handler {
returnfunc(c buffalo.Context) error {
ifuid:=c.Session().Get("current_user_id"); uid!=nil {
u:=&models.User{}
tx:=c.Value("tx").(*pop.Connection)
iferr:=tx.Find(u, uid); err!=nil {
iferrors.Cause(err) ==sql.ErrNoRows {
// The session is valid, but no data matches in db// Drop the sessionc.Session().Delete("current_user_id")
returnnext(c)
}
// Otherwise, this is a real error...returnerrors.WithStack(err)
}
c.Set("current_user", u)
}
returnnext(c)
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When deploying and setting your environment to Development.
I could get to see any page of my website. Wherease in development it was working.
This can be workedaround by deleting your cookies from the users browser.
When switshing back to dev after, the same behaviour arise.
The following erro is thrown in console mode, which is maybe a little too generic to find the problem:
Stan proposed a solution , that is not yet tested :
here
https://github.com/gobuffalo/gothrecipe/blob/master/actions/auth.go#L66
Could be changed for:
Proposed PR by Stan:
The text was updated successfully, but these errors were encountered: