Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Separate loading realm and require realm #530

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

whaught
Copy link
Contributor

@whaught whaught commented Sep 11, 2020

Proposed Changes

  • Currently we lose the selected realm for /admin/realm and /realm this causes the navigation bar to lose all of its options which makes for an unusual experience.
    • Instead always load the selected realm (if one is selected) and only enforce that one be selected for pages that require it

Release Note

Keep the realm selection during realm admin tasks

@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Sep 11, 2020
Copy link
Member

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

I'd like a comment in LoadCurrentRealm since it's a departure from our current pattern, but that can be a followup

@@ -57,7 +49,7 @@ func RequireRealm(ctx context.Context, cacher cache.Cacher, db *database.Databas
realmID := controller.RealmIDFromSession(session)
if realmID == 0 {
logger.Debugw("realm does not exist in session")
controller.MissingRealm(w, r, h)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should comment this noting why we call next.ServerHTTP

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 1ae0509 into google:main Sep 11, 2020
@google google locked and limited conversation to collaborators Oct 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants