aws-amplify / aws-amplify/docs

Bug in calling Auth Admin queries API

Open
#6,945 4 comments 0 reactions 0 assignees View on GitHub
amplify/auth p2
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

In this doc https://docs.amplify.aws/javascript/build-a-backend/auth/admin-actions/, the guide shows that calling API as below:
```
async function listEditors(limit){
let apiName = 'AdminQueries';
let path = '/listUsersInGroup';
let options = {
queryStringParameters: {
"groupname": "Editors",
"limit": limit,
},
headers: {
'Content-Type' : 'application/json',
Authorization: `${(await fetchAuthSession()).tokens.accessToken.payload}`
}
}
const response = await get({apiName, path, options});
return response;
}
```
But I think it missed `Bearer` keyword, specifically
```
Authorization: `Bearer ${(await fetchAuthSession()).tokens.accessToken.payload}`
```
And, please add tutorial to change auth function role from local env

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.