Example app with two-auth login form on separate page.
Um this is how I did it. First step is an AJAX call checking whether the user has otp enabled, then the second step is the actual devise session#new.
Sample code at tommyku/blog3_lab-two_step and the blog post.
This has been extensively discussed on #14, although there’s not a definitive answer or example there, you will find some good pointers.
I've consolidates some of the pieces of advice in the various comments from #14 into the following step by step guide with a sample project: https://www.jamesridgway.co.uk/implementing-a-two-step-otp-u2f-login-workflow-with-rails-and-devise/