8000 fix(coderd): pass oauth configs to site by mafredri · Pull Request #8390 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix(coderd): pass oauth configs to site #8390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add special case for site
  • Loading branch information
mafredri committed Jul 10, 2023
commit 62591187ac0f5b26902d97a3388f9dadca92e553
3 changes: 3 additions & 0 deletions site/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ func (h *Handler) renderHTMLWithState(rw http.ResponseWriter, r *http.Request, f
Optional: true,
DB: h.opts.Database,
OAuth2Configs: h.opts.OAuth2Configs,
Copy link
Member Author
@mafredri mafredri Jul 10, 2023

Choose a reason for hiding this comment

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

Should we pass other extract api key configs, like DisableSessionExpiryRefresh, too?

Edit: We also don't seem to be utilizing e.g. DisableSessionExpiryRefresh in enterprise/coderd, is this a bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

/ping @deansheather (ref: #5976)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we should be setting that flag everywhere we use it, so this is definitely a bug.

For this specific case though, we can just set it to true because it doesn't matter if loading the frontend doesn't refresh the token (because the frontend will make API requests after loading the page).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @deansheather, added the always true and an accompanying comment.

// Special case for site, we can always disable refresh here because
// the frontend will perform API requests if this fails.
DisableSessionExpiryRefresh: true,
})
if apiKey != nil && actor != nil {
ctx := dbauthz.As(r.Context(), actor.Actor)
Expand Down
0