const router = express.Router();
const client = new Client()
.setEndpoint(process.env.APPWRITE_ENDPOINT!)
.setProject(process.env.APPWRITE_PROJECT_ID!);
const account = new Account(client);
router.post("/", async (req: Request, res: Response) => {
try {
const session = await account.createAnonymousSession();
const jwt = await account.createJWT();
res.cookie("token", jwt.jwt, { httpOnly: true });
res.json({
message: "Anonymous login successful",
});
} catch (error) {
res.status(500).json({ error: (error as Error).message });
}
});
"error": "User (role: guests) missing scope (account)"
Any solutions? My end goal is to be able to convert anonymous users to full users and preserve everything while doing so
afaik, you need to set the session secret on client after a login.
session secret is only retrieved when using server sdk with key.
Recommended threads
- Error can not create `tablesdb` event wi...
When i'm trying to add an event with `tablesdb` i get an error message My event value: `tablesdb.mtg-decklist-dev.tables.queue_parsing.rows.*.create` Same err...
- [SOLVED] GitHub Student Login Loop Issue
signed up using my GitHub Student Developer Pack. However, whenever I click "Sign in with GitHub", I get stuck on the login page. No matter how many times I try...
- Google OAuth Not Working on Brave/Firefo...
I'm having an issue with Google OAuth in my React + Appwrite app. After login, the dashboard is accessible only in Microsoft Edge, but fails in Brave and Firefo...