I am building a next js app with directus sdk. when i login with sdk method the refresh token is not returned. not sure if there is an extra setup required.
this is my setup so far.
directus.ts
import {
authentication,
createDirectus,
rest,
staticToken,
} from “directus/sdk”;
import { CustomDirectusTypes } from “../types/directusSchema”;
Hi. I have a similar question. It’s not clear how to re-use the token after authentication. My example is based on Vue JS. I have login (login.vue) page. I want to redirect the user to the Index page after login.
And looks like it is not authorized automatically, so I got a 401 error.
Should I put the createDirecrus to the dedicated JS file and use it across the app? Or I need to create it on every page and put the token from Cookies somehow?
Does anybody have an example of using it in such use cases?