Incorrect redirect on succesful login #11

Closed
opened 2020-10-21 17:42:28 +00:00 by koloml · 4 comments

Finded out that login form redirecting user incorrectly after successful login if current hostname have third-level domain such as mine: carbon.thecore.city.

The reason is location.assign('./') not redirecting user to the parent directory.

On the carbon.chat it works fine:

image

But on the carbon.thecore.city it's just redirecting to the same path.

image

Maybe it's better to use location.assign('..') to move to the parent section.

Finded out that login form redirecting user incorrectly after successful login if current hostname have third-level domain such as mine: [carbon.thecore.city](https://carbon.thecore.city). The reason is `location.assign('./')` not redirecting user to the parent directory. On the [carbon.chat](https://carbon.chat) it works fine: ![image](/attachments/95635063-0583-436a-bde1-d297d9a38144) But on the [carbon.thecore.city](https://carbon.thecore.city) it's just redirecting to the same path. ![image](/attachments/ead5804c-f27c-4060-aa01-bcf7a9ab1d59) Maybe it's better to use `location.assign('..')` to move to the parent section.
6.1 KiB
5.2 KiB
Author

Oh, wait. The reason is the last / in the path. If I'll try to log in using /login then I'll be successfully redirected to Carbon root directory. But there is automatic redirect from /login to /login/ on my webserver.

The same situation on carbon.chat/login/

image

Oh, wait. The reason is the last `/` in the path. If I'll try to log in using `/login` then I'll be successfully redirected to Carbon root directory. But there is automatic redirect from `/login` to `/login/` on my webserver. The same situation on [carbon.chat/login/](https://carbon.chat/login/) ![image](/attachments/94ef4a55-f98d-4b8b-a872-bdc7574c023c)
jboi added the
bug
label 2020-10-21 17:50:37 +00:00
Collaborator

Fixed this in f1b75f5e10

Fixed this in https://gitdab.com/cadence/Carbon/commit/f1b75f5e10b48b1f6fbf801cacf2bfe6a38c2f49
bad closed this issue 2020-10-21 18:05:19 +00:00
Owner

Not entirely fixed - we need to ensure that we go to /login/ (with trailing slash) here: https://gitdab.com/cadence/Carbon/src/branch/princess/src/js/main.js#L8

Not entirely fixed - we need to ensure that we go to `/login/` (with trailing slash) here: https://gitdab.com/cadence/Carbon/src/branch/princess/src/js/main.js#L8
cadence reopened this issue 2020-10-21 23:50:32 +00:00
Owner

Addressed that in 9e71336.

Addressed that in 9e71336.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cadence/Carbon#11
No description provided.