Refresh Token not received on login

Hello,

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”;

export const directus = (token: string = “”) => {
const client = createDirectus(baseUrl).with(rest());

if (token) {
return client.with(staticToken(token));
}

return client.with(authentication(“json”));
};

// Log in to get the access token
const client = directus();
const authData = await client.request(login(email, password));

login response:
{
expires: 900000,
access_token: ‘eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Ijg…I’
}

According to the docs Sdk | Directus Docs you need to add the json mode to the login instead of the authentication function.
Did you try that?