handleIncomingRedirect() w/ redirect creates endless loop

I’m afraid that using Inrupt’s library it’s currently not possible to restore the session silently, without user interaction :/. Yes, Umai is an SPA, but I also tried to restore the session after reloading because if users have already logged in, I think it’s not the best UX to redirect them again. But so far, I don’t think it’s possible.

I have discussed it with Inrupt’s maintainers in these two threads/issues:

However, not everything is lost. I haven’t done it myself, but I’m pretty sure you could use something like Turbo (previously called Turbolinks) to keep the Javascript session alive when you navigate. Essentially, your app would continue being an MPA, but navigation would happen without reloading the page. Maybe it’s not ideal, but with the current limitations I think that’s the best you can do.

Also, I have to wonder, how are you using the library? With the way it works, I’m pretty sure you can only use it in the frontend. So that would mean that you’re not doing any rendering in the server-side. At that point, why not do an SPA? I don’t think there’s anything wrong with an MPA, as you mention, but if I were to make an MPA I’d use some server-side login mechanism that doesn’t rely on Inrupt’s library. That way, you could also do requests server-side, and you don’t even need Javascript (you can implement your app with PHP, Ruby, or whatever you like).

I’m pinging @zwifi in case he has something to add.

4 Likes