Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Refactorying middleware#161

Merged
noahingh merged 4 commits into
mainfrom
refactorying-middleware
Oct 10, 2021
Merged

Refactorying middleware#161
noahingh merged 4 commits into
mainfrom
refactorying-middleware

Conversation

@noahingh

Copy link
Copy Markdown
Member

Move middleware package into the api package

@noahingh noahingh added the bug Something isn't working label Oct 10, 2021
Comment on lines +22 to +33
func (s *Middleware) SetUser() gin.HandlerFunc {
return func(c *gin.Context) {
ctx := c.Request.Context()

u, err := s.i.FindUserByHash(ctx, FindHash(c))
if ent.IsNotFound(err) {
return
}

c.Set(KeyUser, u)
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the 'sess' file into the global package.

@noahingh noahingh merged commit ff50d6e into main Oct 10, 2021
@noahingh noahingh deleted the refactorying-middleware branch October 10, 2021 07:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant