mirror of
https://github.com/strapi/strapi.git
synced 2025-09-09 08:39:45 +00:00
Fix typo
This commit is contained in:
parent
81cf5c4ecd
commit
c79106bff8
@ -16,7 +16,7 @@ To achieve this feature development, we will have to customize the `users-permis
|
|||||||
To manage your tokens, you will have to create a new Content Type named `token`.
|
To manage your tokens, you will have to create a new Content Type named `token`.
|
||||||
|
|
||||||
- `string` attribute named `token`
|
- `string` attribute named `token`
|
||||||
- `relation` attribute **Token** (`user`) - **Token** has and belongs to one **User** - **User** (`token`)
|
- `relation` attribute **Token** (`user`) - **Token** has and belongs to one **User** - **User** (`token`)
|
||||||
|
|
||||||
Then add some users and create some token linked to these users.
|
Then add some users and create some token linked to these users.
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ module.exports = async (ctx, next) => {
|
|||||||
const [token] = await strapi.query('token').find({token: ctx.request.query.token});
|
const [token] = await strapi.query('token').find({token: ctx.request.query.token});
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
throw new Error('Invalid token: This token not exist');
|
throw new Error(`Invalid token: This token doesn't exist`);
|
||||||
} else {
|
} else {
|
||||||
if (token.user && typeof token.token === 'string') {
|
if (token.user && typeof token.token === 'string') {
|
||||||
id = token.user.id;
|
id = token.user.id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user