New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to login page in case of missing authorization header #1326

Closed
cornelinux opened this Issue Nov 29, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@cornelinux
Member

cornelinux commented Nov 29, 2018

What did you try to do?

Reload a page in the web UI, e.g. by hitting F5.

What outcome did you expect?

Being redirected to the login screen.

What outcome did you experience?

We still remain on the last route like
https://myserver/#/token/list

TODO

When hitting F5 we are missing the authorization header.
In all cases, where we are missing the authorization header or the auth header is not valid anymore, we should redirect to the login page.
Maybe we can do this at a central location / error handler.

@cornelinux cornelinux added this to the 3.0 Code Cleanup milestone Nov 29, 2018

@cornelinux

This comment has been minimized.

Member

cornelinux commented Nov 29, 2018

Usually we have this, but this seems broken:

        var error_func = function (error) {
            if (error.result.error.code === -401) {
                $state.go('login');
            } else {
                inform.add(error.result.error.message,
                                {type: "danger", ttl: 10000});
            }
        };

cornelinux added a commit that referenced this issue Nov 29, 2018

redirect to login on reload
I we reload we are missing the authorization header.
The server does not return -401 anymore, but error codes
403x.
We add one central error handling function, that redirects
to the login page (or register or reset)

Closes #1326

@cornelinux cornelinux referenced this issue Nov 29, 2018

Merged

redirect to login on reload #1327

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment