fix
This commit is contained in:
@@ -19,7 +19,7 @@ type UserSessionState struct {
|
||||
func (s *Service) UserSessionState(ctx context.Context, userID uuid.UUID) (UserSessionState, error) {
|
||||
var st UserSessionState
|
||||
err := s.Pool.QueryRow(ctx, `
|
||||
SELECT is_active, session_version
|
||||
SELECT COALESCE(is_active, false), COALESCE(session_version, 0)
|
||||
FROM users
|
||||
WHERE id = $1`, userID).Scan(&st.Active, &st.Version)
|
||||
if isUndefinedColumn(err) {
|
||||
|
||||
@@ -308,11 +308,9 @@ func (s *Server) handleMe(w http.ResponseWriter, r *http.Request) {
|
||||
if accessErr == nil && access.FullAdmin && access.Role == auth.StaffRoleAdmin {
|
||||
staffTenantSwitch = true
|
||||
all, listErr := s.Auth.ListCompanies(r.Context(), 500)
|
||||
if listErr != nil {
|
||||
Error(w, http.StatusInternalServerError, "failed to load companies")
|
||||
return
|
||||
if listErr == nil {
|
||||
companies = all
|
||||
}
|
||||
companies = all
|
||||
}
|
||||
cidStr := s.Sessions.GetString(r.Context(), auth.SessionCompanyIDKey)
|
||||
homeStr := strings.TrimSpace(s.Sessions.GetString(r.Context(), auth.SessionStaffHomeCompanyKey))
|
||||
|
||||
Reference in New Issue
Block a user