Refresh Token broken after update to v5

System Information
  • Strapi Version: v5.5.0
  • Operating System: ubuntu
  • Database: postggres
  • Node Version: v20.11.1
  • NPM Version: v10.9.1
  • Yarn Version:

In Strap v4.x I implemented a refresh token based on this article:

That is currently working correctly in Production.

I am currently updating to Strapi v5.5.0, and I get the following error when trying to start Strapi:
Error creating endpoint POST /token/refresh: Handler not found “auth.refreshToken”

The relevent code in /src/extensions/strapi-server.js looks like:
module.exports = (plugin) => {
…irrelevant code here

plugin.controllers.auth.refreshToken = async (ctx) => {
…refresh logic here
};

plugin.routes[“content-api”].routes.push({
method: “POST”,
path: “/token/refresh”,
handler: “auth.refreshToken”,
config: {
auth: false,
policies: ,
prefix: “”,
},
});

return plugin;
};

Why is the auth.refreshToken handler not being found in V5, when it worked without issue in V4?

For anyone who searches and finds this:
I never found a direct fix for the existing code, but what I did do was change to using this plugin - GitHub - redon2/strapi-plugin-refresh-token: Strapi5 Refresh Token Plugin