MCPcopy
hub / github.com/writefreely/writefreely / addSessionFlash

Function addSessionFlash

session.go:76–90  ·  view source on GitHub ↗
(app *App, w http.ResponseWriter, r *http.Request, m string, session *sessions.Session)

Source from the content-addressed store, hash-verified

74}
75
76func addSessionFlash(app *App, w http.ResponseWriter, r *http.Request, m string, session *sessions.Session) error {
77 var err error
78 if session == nil {
79 session, err = app.sessionStore.Get(r, cookieName)
80 }
81
82 if err != nil {
83 log.Error("Unable to add flash '%s': %v", m, err)
84 return err
85 }
86
87 session.AddFlash(m)
88 saveUserSession(app, r, w)
89 return nil
90}
91
92func getUserAndSession(app *App, r *http.Request) (*User, *sessions.Session) {
93 session, err := app.sessionStore.Get(r, cookieName)

Callers 15

existingPostFunction · 0.85
viewOauthCallbackMethod · 0.85
updateSettingsFunction · 0.85
viewResetPasswordFunction · 0.85
handleResetPasswordInitFunction · 0.85
handleUserDeleteFunction · 0.85
WebErrorsMethod · 0.85
existingCollectionFunction · 0.85
handleLogOutCollectionFunction · 0.85
handleViewInviteFunction · 0.85

Calls 1

saveUserSessionFunction · 0.85

Tested by

no test coverage detected