mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-11 23:08:10 +00:00
feat: initial wip frontend
This commit is contained in:
@@ -63,6 +63,8 @@ func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
tlog.App.Trace().Interface("cookies", c.Request.Cookies()).Msg("cookies")
|
||||
|
||||
cookie, err := m.auth.GetSessionCookie(c)
|
||||
|
||||
if err != nil {
|
||||
@@ -134,6 +136,18 @@ func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
|
||||
c.Set("context", &ctx)
|
||||
c.Next()
|
||||
return
|
||||
case "tailscale":
|
||||
m.auth.RefreshSessionCookie(c)
|
||||
ctx := m.addTailscaleContext(c, config.UserContext{
|
||||
Username: cookie.Username,
|
||||
Name: cookie.Name,
|
||||
Email: cookie.Email,
|
||||
Provider: cookie.Provider,
|
||||
IsLoggedIn: true,
|
||||
})
|
||||
c.Set("context", &ctx)
|
||||
c.Next()
|
||||
return
|
||||
default:
|
||||
_, exists := m.broker.GetService(cookie.Provider)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user