Skip to content

Commit

Permalink
docs: clarify api flow use
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Aug 25, 2020
1 parent 7e367e7 commit a38b4a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 6 additions & 7 deletions selfservice/flow/login/handler.go
Expand Up @@ -99,10 +99,13 @@ type initializeSelfServiceBrowserLoginFlow struct {
//
// To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`.
//
// :::note
// :::warning
//
// This endpoint is NOT INTENDED for browser applications (Chrome, Firefox, ...). We recommend using this endpoint
// for server-side browser applications and single page apps (SPA).
// You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server
// Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make
// you vulnerable to a variety of CSRF attacks, including CSRF login attacks.
//
// This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).
//
// :::
//
Expand Down Expand Up @@ -151,12 +154,8 @@ func (h *Handler) initAPIFlow(w http.ResponseWriter, r *http.Request, _ httprout
// exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter
// `?refresh=true` was set.
//
// :::note
//
// This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...).
//
// :::
//
// More information can be found at [ORY Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
//
// Schemes: http, https
Expand Down
9 changes: 6 additions & 3 deletions selfservice/flow/registration/handler.go
Expand Up @@ -89,10 +89,13 @@ func (h *Handler) NewRegistrationFlow(w http.ResponseWriter, r *http.Request, ft
//
// To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`.
//
// :::note
// :::warning
//
// You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server
// Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make
// you vulnerable to a variety of CSRF attacks.
//
// This endpoint is NOT INTENDED for browser applications (Chrome, Firefox, ...). We recommend using this endpoint
// for server-side browser applications and single page apps (SPA).
// This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...).
//
// :::
//
Expand Down

0 comments on commit a38b4a1

Please sign in to comment.