From 6cffc449c606d570ef010ec4471deb32dcbe8295 Mon Sep 17 00:00:00 2001 From: arielbk Date: Mon, 6 Dec 2021 15:06:42 +0100 Subject: [PATCH] Remaining auth v4 changes There are still some references to the v3 auth endpoints (without `/api` at the start) on the Users and Permissions plugin documentation. # What does it do? Updates Strapi endpoints to include `/api` at the start # Why is it needed? This change should be documented; it caused a lot of confusion for me as I was trying to figure out why my authentication was not working on v4. # Related issue(s)/PR(s) A similar thing was fixed for the guides in PR #553 --- .../latest/plugins/users-permissions.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/developer-docs/latest/plugins/users-permissions.md b/docs/developer-docs/latest/plugins/users-permissions.md index a5cfc4b6c6..21347f5b89 100644 --- a/docs/developer-docs/latest/plugins/users-permissions.md +++ b/docs/developer-docs/latest/plugins/users-permissions.md @@ -113,7 +113,7 @@ import axios from 'axios'; // Request API. // Add your own code here to customize or restrict how the public can register new users. axios - .post('http://localhost:1337/auth/local/register', { + .post('http://localhost:1337/api/auth/local/register', { username: 'Strapi user', email: 'user@strapi.io', password: 'strapiPassword', @@ -143,7 +143,7 @@ import axios from 'axios'; // Request API. axios - .post('http://localhost:1337/auth/local', { + .post('http://localhost:1337/api/auth/local', { identifier: 'user@strapi.io', password: 'strapiPassword', }) @@ -356,7 +356,7 @@ The use of `ngrok` is not needed. - **Client ID**: fill in the **App client id** (`5bd7a786qdupjmi0b3s10vegdt`) - **Client Secret**: fill in the **App client secret** (`19c5c78dsfsdfssfsdfhpdb4nkpb145vesdfdsfsffgh7vwd6g45jlipbpb`) - **Host URI (Subdomain)**: fill in the URL value that you copied earlier (`myapp67b50345-67b50b17-local.auth.eu-central-1.amazoncognito.com`) - - **The redirect URL to your front-end app**: if you are using strapi react-login [https://github.com/strapi/strapi-examples/tree/master/login-react/](https://github.com/strapi/strapi-examples/tree/master/login-react/) use `http://localhost:3000/connect/cognito/redirect` but if you do not yet have a front-end app to test your Cognito configuration you can then use the following URL `http://localhost:1337/auth/cognito/callback` + - **The redirect URL to your front-end app**: if you are using strapi react-login [https://github.com/strapi/strapi-examples/tree/master/login-react/](https://github.com/strapi/strapi-examples/tree/master/login-react/) use `http://localhost:3000/connect/cognito/redirect` but if you do not yet have a front-end app to test your Cognito configuration you can then use the following URL `http://localhost:1337/api/auth/cognito/callback` ::: @@ -747,7 +747,7 @@ import axios from 'axios'; // Request API. axios - .post('http://localhost:1337/auth/forgot-password', { + .post('http://localhost:1337/api/auth/forgot-password', { email: 'user@strapi.io', // user's email }) .then(response => { @@ -770,7 +770,7 @@ import axios from 'axios'; // Request API. axios - .post('http://localhost:1337/auth/reset-password', { + .post('http://localhost:1337/api/auth/reset-password', { code: 'privateCode', // code contained in the reset link of step 3. password: 'userNewPassword', passwordConfirmation: 'userNewPassword', @@ -802,7 +802,7 @@ import axios from 'axios'; // Request API. axios - .post(`http://localhost:1337/auth/send-email-confirmation`, { + .post(`http://localhost:1337/api/auth/send-email-confirmation`, { email: 'user@strapi.io', // user's email }) .then(response => {