angularjs http interceptor login pattern

128 views Asked by At

I'm using an angularjs http interceptor to check if the token is valid. If not, it redirects to a login page. But when a token is expired and a user was busy filling in a form for example, they will lose their work like this (redirecting to a login page when they click submit for example).

What I want is to re-do the last http action after they have logged in, or go back to where they were. I can think of many ways to tackle this problem but my question is if there's a pattern / common way of doing this in a client side web app like angularjs.

0

There are 0 answers