Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-D-Lewis committed Jan 28, 2025
1 parent a0f4efe commit f180f07
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pathlib import Path

import z2jh
from tornado import gen


def base_profile_home_mounts(username):
Expand Down Expand Up @@ -547,17 +546,12 @@ def preserve_envvars(spawner):
return profile


@gen.coroutine
def render_profiles(spawner):
async def render_profiles(spawner):
# jupyterhub does not yet manage groups but it will soon
# so for now we rely on auth_state from the keycloak
# userinfo request to have the groups in the key
# "auth_state.oauth_user.groups"
auth_state = yield spawner.user.get_auth_state()
if not auth_state:
if spawner.user.name == "service-account-jupyterhub":
auth_state = yield spawner.authenticator.authenticate_service_account()

auth_state = await spawner.user.get_auth_state()
username = auth_state["oauth_user"]["preferred_username"]

# only return the lowest level group name
Expand Down

0 comments on commit f180f07

Please sign in to comment.