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?
Hello, if your login problem is not solved yet take a look at this repo, this might help https://github.com/khanahmad4527/directus-react-google-sso After authentication you will have to fetch the current user details so for that check this https://directus.io/docs/api/users#retrieve-current-user
– ahmad_quvor