mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-14 08:42:51 +02:00
authenticate: getUserInfoData() cleanup (#4818)
The Authenticate.getUserInfoData() method has an error return value, but always returns nil for this value. Let's remove this return value from the method signature.
This commit is contained in:
parent
8068890e57
commit
3b2bdd059a
1 changed files with 4 additions and 14 deletions
|
@ -98,12 +98,7 @@ func (a *Authenticate) mountDashboard(r *mux.Router) {
|
||||||
sr.Path("/").Handler(a.requireValidSignatureOnRedirect(a.userInfo))
|
sr.Path("/").Handler(a.requireValidSignatureOnRedirect(a.userInfo))
|
||||||
sr.Path("/sign_in").Handler(httputil.HandlerFunc(a.SignIn))
|
sr.Path("/sign_in").Handler(httputil.HandlerFunc(a.SignIn))
|
||||||
sr.Path("/device-enrolled").Handler(httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
sr.Path("/device-enrolled").Handler(httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
||||||
userInfoData, err := a.getUserInfoData(r)
|
handlers.DeviceEnrolled(a.getUserInfoData(r)).ServeHTTP(w, r)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
handlers.DeviceEnrolled(userInfoData).ServeHTTP(w, r)
|
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -502,16 +497,11 @@ func (a *Authenticate) userInfo(w http.ResponseWriter, r *http.Request) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
userInfoData, err := a.getUserInfoData(r)
|
handlers.UserInfo(a.getUserInfoData(r)).ServeHTTP(w, r)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
handlers.UserInfo(userInfoData).ServeHTTP(w, r)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Authenticate) getUserInfoData(r *http.Request) (handlers.UserInfoData, error) {
|
func (a *Authenticate) getUserInfoData(r *http.Request) handlers.UserInfoData {
|
||||||
state := a.state.Load()
|
state := a.state.Load()
|
||||||
|
|
||||||
s, err := a.getSessionFromCtx(r.Context())
|
s, err := a.getSessionFromCtx(r.Context())
|
||||||
|
@ -527,7 +517,7 @@ func (a *Authenticate) getUserInfoData(r *http.Request) (handlers.UserInfoData,
|
||||||
|
|
||||||
BrandingOptions: a.options.Load().BrandingOptions,
|
BrandingOptions: a.options.Load().BrandingOptions,
|
||||||
}
|
}
|
||||||
return data, nil
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
// revokeSession always clears the local session and tries to revoke the associated session stored in the
|
// revokeSession always clears the local session and tries to revoke the associated session stored in the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue