migrated from cup session to core/session.go, Contains the new SessionUser struct and the CreateAuthTokenHashedCacheKey utility function

This commit is contained in:
Zeni Kim 2026-05-18 13:02:06 -05:00
parent 7c164ef58f
commit 75ddca3e7d
3 changed files with 156 additions and 0 deletions

View file

@ -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)