migrated from cup session to core/session.go, Contains the new SessionUser struct and the CreateAuthTokenHashedCacheKey utility function
This commit is contained in:
parent
7c164ef58f
commit
75ddca3e7d
3 changed files with 156 additions and 0 deletions
9
core.go
9
core.go
|
|
@ -277,6 +277,7 @@ func (app *App) makeHTTPRouterHandlerFunc(h Controller, ms []Hook) httprouter.Ha
|
|||
GetMailer: resolveMailer(),
|
||||
GetEventsManager: resolveEventsManager(),
|
||||
GetLogger: resolveLogger(),
|
||||
GetSession: getSession(),
|
||||
}
|
||||
|
||||
ctx.prepare(ctx)
|
||||
|
|
@ -685,6 +686,14 @@ func resolveLogger() func() *logger.Logger {
|
|||
return f
|
||||
}
|
||||
|
||||
// getSession returns a function that creates and returns a new SessionUser instance when invoked.
|
||||
func getSession() func() *SessionUser {
|
||||
f := func() *SessionUser {
|
||||
return &SessionUser{}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
// MakeDirs creates the specified directories under the base path with the provided permissions (0766).
|
||||
func (app *App) MakeDirs(dirs ...string) {
|
||||
o := syscall.Umask(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue