mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
The main index template renders now!
This commit is contained in:
25
web/context.go
Normal file
25
web/context.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/gorilla/sessions"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
Session *sessions.Session
|
||||
}
|
||||
|
||||
func (c *Context) Close() {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
func NewContext(req *http.Request) (*Context, error) {
|
||||
sess, err := sessionStore.Get(req, "inbucket")
|
||||
ctx := &Context{
|
||||
Session: sess,
|
||||
}
|
||||
if err != nil {
|
||||
return ctx, err
|
||||
}
|
||||
return ctx, err
|
||||
}
|
||||
Reference in New Issue
Block a user