Closed sherif2011 closed 5 years ago
You need to add @authorize decorator to the methods. If you want the APIs to be publically available, just do @authenticate(["*"])
Here is my code, and I am still getting same above error. Any clue?
@authorize(['*'])
@get('/user-credentials/count', {
responses: {
'200': {
description: 'UserCredentials model count',
content: {'application/json': {schema: CountSchema}},
},
},
})
async count(
@param.query.object('where', getWhereSchemaFor(UserCredentials))
where?: Where
You can check my project here I have tried adding a test controller, which worked perfectly well whether with authorize(['*'] or with specific permissions.... but credentials controller isn't working
Never mind, I got it figured out. It was the inconsistency between controller name and end point name. Thanks!
Hello,
I couldn't find any controllers to set or reset user password. What's the best way to do that? I tried creating a controller using lb4/cli
? What kind of controller would you like to generate? REST Controller with CRUD functions ? What is the name of the model to use with this CRUD repository? UserCredentials ? What is the name of your CRUD repository? UserCredentialsRepository ? What is the type of your ID? number ? What is the base HTTP path name of the CRUD operations? /user-credentials create src\controllers\credentials.controller.ts update src\controllers\index.ts
Controller Credentials was created in src\controllers/
When I try accessing any of the end points I am getting { "error": { "statusCode": 403, "name": "ForbiddenError", "message": "NotAllowedAccess" } }
Thanks!!