Skip to content

403 response, You are not allowed to perform this action when trying to populate via api #725

Answered by iasisalomon
iasisalomon asked this question in Q&A
Discussion options

You must be logged in to vote

Found the error i was adding bearer to the token to store it, but needed it pure for token and Cookie.

bearer = 'Bearer ' + res.body.token;

Code that actually works:

		test('First Player', async () => {
			const res = await chai
				.request(uri)
				.post('/api/players')
				.set('Cookie', 'payload-token=' + bearer)
				.set('Authorization', bearer)
				.send({
					nickname: 'pixel',
					team: 'pixel',
					ronin: 'asd',
					nationality: 'asdasfasfas',
				});
			console.log(res.body);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by denolfe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant