From 2a4df015fedbdfe9ae30f98f07d64a6f98683bd2 Mon Sep 17 00:00:00 2001 From: Tom Shortall Date: Mon, 19 Dec 2022 22:08:46 +0000 Subject: [PATCH 1/5] user-permissions plugin: document how to add Patreon as an Oauth provider --- .../latest/plugins/users-permissions.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/developer-docs/latest/plugins/users-permissions.md b/docs/developer-docs/latest/plugins/users-permissions.md index 384205c2f3..17f4ff77af 100644 --- a/docs/developer-docs/latest/plugins/users-permissions.md +++ b/docs/developer-docs/latest/plugins/users-permissions.md @@ -786,6 +786,45 @@ The use of `ngrok` is not needed. ::: +::: tab Patreon + +#### Using ngrok + +Patreon does not accept `localhost` urls.
+Use `ngrok` to serve the backend app. + +``` +ngrok http 1337 +``` + +Don't forget to update the server url in the backend config file `config/server.js` and the server url in your frontend app (environment variable `REACT_APP_BACKEND_URL` if you use [react login example app](https://github.com/strapi/strapi-examples/tree/master/login-react)) with the generated ngrok url. + +#### Patreon configuration + +- You must be a Patreon Creator in order to register an Oauth client. +- Go to the [Patreon developer portal](https://www.patreon.com/portal) +- Click on [Clients & API Keys](https://www.patreon.com/portal/registration/register-clients) +- Click on "Create Client" +- Enter the details of your organisation and website. +- There is a drop-down for "App Category" but no explanation of what the different categories mean. +"Community" seems to work fine. +- You can choose either version 1 or version 2 of the API - neither are actively developed. +Version 2 is probably the best choice. See their +[developer docs](https://docs.patreon.com/#introduction) for more detail. +- Under "Redirect URI's" enter `https://your-site.com/api/connect/patreon/callback` +- Save the client details and you will then see the Client ID and Client Secret. + +#### Strapi configuration + +- Visit the User Permissions provider settings page
[http://localhost:1337/admin/settings/users-permissions/providers](http://localhost:1337/admin/settings/users-permissions/providers) +- Click on the **Patreon** provider +- Fill the information: + - Enable: `ON` + - Client ID: `` - as above + - Client Secret: `` - as above + +::: + :::: Your configuration is done. From 78a1e7544fe3219c1ab557402279f48b2c6f44d1 Mon Sep 17 00:00:00 2001 From: Jorge Martin <53431308+HastaCs@users.noreply.github.com> Date: Thu, 2 Feb 2023 15:30:44 +0100 Subject: [PATCH 2/5] Update filtering-locale-publication.md (#1441) for this pull https://github.com/strapi/strapi/pull/15046 --- .../rest/filtering-locale-publication.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.md index 071717d58d..d3c5edf73b 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/rest/filtering-locale-publication.md @@ -46,7 +46,9 @@ The following operators are available: | `$notNull` | Is not null | | `$between` | Is between | | `$startsWith` | Starts with | +| `$startsWithi` | Starts with (case-insensitive) | | `$endsWith` | Ends with | +| `$endsWithi` | Ends with (case-insensitive) | | `$or` | Joins the filters in an "or" expression | | `$and` | Joins the filters in an "and" expression | @@ -422,4 +424,4 @@ await request(`/api/articles?${query}`); ``` ::: -:::: \ No newline at end of file +:::: From b0bfb7821eb0d0f6366a201ba9998b7033de9677 Mon Sep 17 00:00:00 2001 From: Shaun Brown <97027841+StrapiShaun@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:01:21 +0000 Subject: [PATCH 3/5] Update docs/developer-docs/latest/plugins/users-permissions.md --- docs/developer-docs/latest/plugins/users-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/plugins/users-permissions.md b/docs/developer-docs/latest/plugins/users-permissions.md index 17f4ff77af..91c3b38fd6 100644 --- a/docs/developer-docs/latest/plugins/users-permissions.md +++ b/docs/developer-docs/latest/plugins/users-permissions.md @@ -805,7 +805,7 @@ Don't forget to update the server url in the backend config file `config/server. - Go to the [Patreon developer portal](https://www.patreon.com/portal) - Click on [Clients & API Keys](https://www.patreon.com/portal/registration/register-clients) - Click on "Create Client" -- Enter the details of your organisation and website. +- Enter the details of your organization and website. - There is a drop-down for "App Category" but no explanation of what the different categories mean. "Community" seems to work fine. - You can choose either version 1 or version 2 of the API - neither are actively developed. From 16927730ae0b176354e6fd13569bbee266feba1d Mon Sep 17 00:00:00 2001 From: Shaun Brown <97027841+StrapiShaun@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:01:44 +0000 Subject: [PATCH 4/5] Update docs/developer-docs/latest/plugins/users-permissions.md --- docs/developer-docs/latest/plugins/users-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/plugins/users-permissions.md b/docs/developer-docs/latest/plugins/users-permissions.md index 91c3b38fd6..bbe4a76243 100644 --- a/docs/developer-docs/latest/plugins/users-permissions.md +++ b/docs/developer-docs/latest/plugins/users-permissions.md @@ -797,7 +797,7 @@ Use `ngrok` to serve the backend app. ngrok http 1337 ``` -Don't forget to update the server url in the backend config file `config/server.js` and the server url in your frontend app (environment variable `REACT_APP_BACKEND_URL` if you use [react login example app](https://github.com/strapi/strapi-examples/tree/master/login-react)) with the generated ngrok url. +Don't forget to update the server url in the Strapi config file `./config/server.js` and the server URL in your frontend app (environment variable `REACT_APP_BACKEND_URL` if you use [react login example app](https://github.com/strapi/strapi-examples/tree/master/login-react)) with the generated ngrok URL. #### Patreon configuration From ee30cdc74333cb3832cc09aa7cbfaf615dafe813 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 6 Feb 2023 15:30:56 +0100 Subject: [PATCH 5/5] Fix broken links reported in issue #1423 (#1484) * Fix broken links reported in issue #1423 * Fix BE custom. > middlewares link --- .../latest/developer-resources/error-handling.md | 4 ++-- .../developer-docs/latest/developer-resources/unit-testing.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developer-docs/latest/developer-resources/error-handling.md b/docs/developer-docs/latest/developer-resources/error-handling.md index 71927b73c8..b5a816f9df 100644 --- a/docs/developer-docs/latest/developer-resources/error-handling.md +++ b/docs/developer-docs/latest/developer-resources/error-handling.md @@ -63,7 +63,7 @@ Errors thrown by the GraphQL API are included in the [response](/developer-docs/ ### Controllers and middlewares -The recommended way to throw errors when developing any custom logic with Strapi is to have the [controller](/developer-docs/latest/development/backend-customization/controllers.md) or [middleware](/developer-docs/latest/development/backend-customization/) respond with the correct status and body. +The recommended way to throw errors when developing any custom logic with Strapi is to have the [controller](/developer-docs/latest/development/backend-customization/controllers.md) or [middleware](/developer-docs/latest/development/backend-customization/middlewares.md) respond with the correct status and body. This can be done by calling an error function on the context (i.e. `ctx`). Available error functions are listed in the [http-errors documentation](https://github.com/jshttp/http-errors#list-of-all-constructors) but their name should be lower camel-cased to be used by Strapi (e.g. `badRequest`). @@ -367,7 +367,7 @@ throw new PolicyError('Something went wrong', { policy: 'my-policy' }); ::: tab Pagination -The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters: +The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-docs/latest/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters: | Parameter | Type | Description | Default | | --- | --- | --- | --- | diff --git a/docs/developer-docs/latest/developer-resources/unit-testing.md b/docs/developer-docs/latest/developer-resources/unit-testing.md index d63531c26f..6c1557d5a0 100644 --- a/docs/developer-docs/latest/developer-resources/unit-testing.md +++ b/docs/developer-docs/latest/developer-resources/unit-testing.md @@ -96,7 +96,7 @@ module.exports = ({ env }) => ({ ### Strapi instance In order to test anything we need to have a strapi instance that runs in the testing environment, -basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](process-manager.md). +basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/process-manager.md). These tasks require adding some files - let's create a folder `tests` where all the tests will be put and inside it, next to folder `helpers` where main Strapi helper will be in file strapi.js.