Login issue after migration has been completed successfully

Hi there,

So I migrated our blog from 1 provider to a different provider. Setup & configured everything and working 100% but when I try to log into the admin side domain.com/ghost I get this error below :

What should I do to fix it?

Any help or input would be greatly appreciated.

Thanks :folded_hands:

Ghost cannot send an email – most certainly the device verification code you’d enter in the next step.

The exact error would be in the Ghost logs, which your provider should have access to. Probably best to reach out to them :slight_smile:

If you’re self hosting, run ghost log from the directory you installed Ghost in (or docker logs ... if you’re using Docker).

How do I disable the device verification step?

I have access to the logs, please see below :

[2025-07-24 18:52:45] INFO "GET /content/images/size/w1000/2025/04/1.png" 200 15ms
[2025-07-24 18:53:17] INFO "GET /" 200 197ms
[2025-07-24 18:53:26] INFO "GET /content/images/size/w1000/2025/04/1--1-.png" 200 11ms
[2025-07-24 18:53:48] INFO "GET /content/images/size/w1000/2025/03/1--2-.png" 200 10ms
[2025-07-24 18:53:49] INFO "GET /content/images/size/w1000/2025/03/3--1-.png" 200 8ms
[2025-07-24 18:54:18] INFO "GET /" 200 163ms
[2025-07-24 18:54:24] INFO "GET /content/images/size/w1000/2025/04/1.png" 200 9ms
[2025-07-24 18:54:24] INFO "GET /content/images/size/w1000/2025/04/1--1-.png" 200 6ms
[2025-07-24 18:55:19] INFO "GET /" 200 148ms
[2025-07-24 18:56:20] INFO "GET /" 200 142ms
[2025-07-24 18:57:22] INFO "GET /" 200 125ms
[2025-07-24 18:57:30] INFO "GET /cdn-cgi/rum" 301 3ms
[2025-07-24 18:57:32] INFO "GET /cdn-cgi/rum/" 404 93ms
[2025-07-24 18:58:23] INFO "GET /" 200 148ms
[2025-07-24 18:59:24] INFO "GET /" 200 138ms
[2025-07-24 19:01:45] WARN

NAME: HelperWarning
CODE: SLOW_GET_HELPER
MESSAGE: {{#get}} helper took 300ms to complete

level: normal

ERROR DETAILS:
    {"api":"postsPublic.browse","apiOptions":{"limit":"all","include":"authors,tags","filter":"featured:true","context":{"member":null}},"time":300,"returnedRows":24}

Is that helpful or not really.

What other options do I have?

You’d need to find the part of the logs related to the mail error.

Your problem is probably that the mail configuration is not set up – that is necessary in production:

You can turn off the device verification through the configuration as well. See " Security" on the page I linked.

Found this :
"name":"EmailError","statusCode":500,"level":"normal","message":"Failed to send email. Please check your site configuration and try again.","help":"\"Please see https://ghost.org/docs/config/#mail for instructions on configuring email.\"","stack":"EmailError: Failed to send email. Please check your site configuration and try again.\n at Object.sendAuthCodeToUser (/var/www/sdfsdfsdfds-blog/versions/5.130.2/core/server/services/auth/session/session-service.js:284:19)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.createSession (/var/www/sdfdsfsdf-blog/versions/5.130.2/core/server/services/auth/session/middleware.js:16:17)","hideStack":false},"msg":"Failed to send email. Please check your site configuration and try again.","time":"2025-07-24T19:19:22.401Z","v":0}

I had a look at it earlier, we have a mailgun account and configured it but doesn’t look like its working, I’ve added the location, the domain and the api key :

Not sure what to do from here?

I didn’t have to turned it off, was off by default, see below :
Ghost_Security_Issue

And if I log out of the current browser, I lose access completely :face_in_clouds:

Please check the link I sent. The settings in Ghost’s UI are not the configuration of your site.

The configuration is set either in a configuration.[environment].json, like a configuration.production.json, or by setting environment variables.

Your first screenshot regarding Mailgun only affects bulk emailing in Ghost (newsletters), not transactional emails.

The second screenshot is in regard to ALL staff logins. That is different than the device verification, which only asks for verification upon the first sign in from a new device. The latter can only be disabled through the configuration.

Thanks, I will add this part below in the config.production.json file and let you know if it worked.

"security": {
    "staffDeviceVerification": false
}

Thanks.

In the long-term, you should add the mail configuration. It is a requirement for production use cases of Ghost, and all future updates will therefore assume this is set up properly.

Disabling the device verification is patching the symptom, but not fixing the problem. This will pop up when you’d need to reset your password, a member wants to sign up for your newsletter, or you’d want to receive notifications for comments made on your blog.

That worked, will look at it and fix it.

We won’t have any users subscribing or sent out any newsletters, maybe the password reset.

Thanks @jannis :+1: