Skip to content
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

fix: document login refresh parameter in swagger #482

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions .schema/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@
],
"summary": "Initialize browser-based login user flow",
"operationId": "initializeSelfServiceBrowserLoginFlow",
"parameters": [
{
"type": "boolean",
"description": "Refresh a login session\n\nIf set to true, this will refresh an existing login session by\nasking the user to sign in again. This will reset the\nauthenticated_at time of the session.",
"name": "refresh",
"in": "query"
}
],
"responses": {
"302": {
"description": "Empty responses are sent when, for example, resources are deleted. The HTTP status code for empty responses is\ntypically 201."
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions selfservice/flow/login/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ func (h *Handler) NewLoginRequest(w http.ResponseWriter, r *http.Request) (*Requ
return a, nil
}

// nolint:deadcode,unused
// swagger:parameters initializeSelfServiceBrowserLoginFlow
type initializeSelfServiceBrowserLoginFlow struct {
// Refresh a login session
//
// If set to true, this will refresh an existing login session by
// asking the user to sign in again. This will reset the
// authenticated_at time of the session.
//
// in: query
Refresh bool `json:"refresh"`
}

// swagger:route GET /self-service/browser/flows/login public initializeSelfServiceBrowserLoginFlow
//
// Initialize browser-based login user flow
Expand Down
2 changes: 1 addition & 1 deletion selfservice/flow/settings/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *ErrorHandler) reauthenticate(
s.c.SelfPublicURL()
u := urlx.AppendPaths(
urlx.CopyWithQuery(s.c.SelfPublicURL(), url.Values{
"refresh": {"true"},
"refresh": {"true"},
"return_to": {returnTo.String()},
}), login.BrowserLoginPath)

Expand Down