Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
Appwrite - JWT doesn't allow to access documents

I'm unable to make a request to my backend using a JWT created when the user logs in in the frontend.

Everytime I try, even if the access to the collection is set to role:all, I get this error from the backend:

{
    "statusCode": 500,
    "code": "401",
    "error": "Internal Server Error",
    "message": "<User> (role: member) missing scope (collections.read)"
}

I'm using Appwrite Node SDK for server part and Appwrite web sdk in the frontend.

This is my login script where I generate the JWT token:

import { Appwrite } from "appwrite";

export const login = async (email, password) => {
    const api = new Appwrite();
    api.setEndpoint(import.meta.env.VITE_APPWRITE_URL);
    api.setProject(import.meta.env.VITE_APPWRITE_PROJECT);
    await api.account.createSession(email, password);
    const user = await api.account.get();
    const jwt = await api.account.createJWT();
    return {
        jwt: jwt.jwt,
        user: {
            id: user.$id,
            email: user.email,
            name: user.name
        },
    }
}

What am I missing?

Note: I am running everything inside Docker containers.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda