Strapi
🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript, fully customizable and developer-first.
Advertisement
Strapi Reference
MySQL Instructions
CREATE DATABASE strapi;
CREATE USER 'strapi'@'localhost';
GRANT ALL PRIVILEGES ON strapi.* TO 'strapi'@'localhost';
ALTER USER 'strapi'@'localhost' IDENTIFIED WITH mysql_native_password BY 'strapi';
FLUSH PRIVILEGES;
EXIT;
What to do if you run into the Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
error?
In this scenario, you probably did what I did and altered the password with
ALTER USER 'strapi'@'localhost' IDENTIFIED BY 'strapi';
which is incorrect, insertWITH mysql_native_password
in there and you should be good afterwards.
hCaptcha
- In the .env include the secret_key , which you can obtain from hCaptcha via their settings for the account.
- Note: HCAPTCHA=secret_key
i18n
Login
- The login for Strapi can be either a combination of
username + password
oremail + password
. Bothusername
andemail
are passed through as an entity defined asindentifier
. After the login action is sucessful, the API returns two variables:- User:
- This is the
user
data that contains the following information:username
userid
email
- There are other fields of information that are customizable and the schema can be referenced in our
API
.
- This is the
- JWT:
- The JWT (
jwt
ortoken
) is an extremely important piece of data that contains the authentication for the user. We are currently reviewing how we should go about storing this token and utilizing it later down the line.
- The JWT (
- User:
Register
- For registration, we ask the user to submit a generic form that contains the following variables:
- Username
- If the
username
is taken, Strapi does return an error back as a response stating that theusername
was taken.
- If the
- Email
- If the
email
is taken and we disablemulti-account
on the Strapi backend, then it will return an error back as a response stating that theemail
was taken.
- If the
- Password
- Password is encrypted and stored as a hashed variable within the database.
- Security (as a Captcha via hCaptcha)
- After the user solves the captcha, an one-time code is generated, which is passed along as a
token
. If the captcha is wrong or missing, the Strapi returns an error.
- After the user solves the captcha, an one-time code is generated, which is passed along as a
- Username
- We still need to take the errors that
Strapi
sends back , parse and then render them client side.
Journal
- Updating to 4.5v and then re-organizing the notes!
Advertisement