mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-05-15 08:40:20 +00:00
feat: initial wip frontend
This commit is contained in:
@@ -11,16 +11,17 @@ import (
|
||||
)
|
||||
|
||||
type UserContextResponse struct {
|
||||
Status int `json:"status"`
|
||||
Message string `json:"message"`
|
||||
IsLoggedIn bool `json:"isLoggedIn"`
|
||||
Username string `json:"username"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Provider string `json:"provider"`
|
||||
OAuth bool `json:"oauth"`
|
||||
TotpPending bool `json:"totpPending"`
|
||||
OAuthName string `json:"oauthName"`
|
||||
Status int `json:"status"`
|
||||
Message string `json:"message"`
|
||||
IsLoggedIn bool `json:"isLoggedIn"`
|
||||
Username string `json:"username"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Provider string `json:"provider"`
|
||||
OAuth bool `json:"oauth"`
|
||||
TotpPending bool `json:"totpPending"`
|
||||
OAuthName string `json:"oauthName"`
|
||||
TailscaleNodeName string `json:"tailscaleNodeName"`
|
||||
}
|
||||
|
||||
type AppContextResponse struct {
|
||||
@@ -91,6 +92,10 @@ func (controller *ContextController) userContextHandler(c *gin.Context) {
|
||||
OAuthName: context.OAuthName,
|
||||
}
|
||||
|
||||
if context.Tailscale != nil {
|
||||
userContext.TailscaleNodeName = context.Tailscale.NodeName
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
tlog.App.Debug().Err(err).Msg("No user context found in request")
|
||||
userContext.Status = 401
|
||||
|
||||
Reference in New Issue
Block a user