mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
add login details to RegisterResponse so GUI clients show login display name
This commit is contained in:
parent
8843188b84
commit
0603e29c46
2
api.go
2
api.go
@ -147,6 +147,8 @@ func (h *Headscale) RegistrationHandler(c *gin.Context) {
|
|||||||
resp.AuthURL = ""
|
resp.AuthURL = ""
|
||||||
resp.MachineAuthorized = true
|
resp.MachineAuthorized = true
|
||||||
resp.User = *m.Namespace.toUser()
|
resp.User = *m.Namespace.toUser()
|
||||||
|
resp.Login = *m.Namespace.toLogin()
|
||||||
|
|
||||||
respBody, err := encode(resp, &mKey, h.privateKey)
|
respBody, err := encode(resp, &mKey, h.privateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().
|
log.Error().
|
||||||
|
@ -216,3 +216,14 @@ func (n *Namespace) toUser() *tailcfg.User {
|
|||||||
}
|
}
|
||||||
return &u
|
return &u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *Namespace) toLogin() *tailcfg.Login {
|
||||||
|
l := tailcfg.Login{
|
||||||
|
ID: tailcfg.LoginID(n.ID),
|
||||||
|
LoginName: n.Name,
|
||||||
|
DisplayName: n.Name,
|
||||||
|
ProfilePicURL: "",
|
||||||
|
Domain: "headscale.net",
|
||||||
|
}
|
||||||
|
return &l
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user