Skip to content
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

miq_token - move API auth from sessionStorage to localStorage #3065

Merged
merged 1 commit into from
Dec 21, 2017
Merged

miq_token - move API auth from sessionStorage to localStorage #3065

merged 1 commit into from
Dec 21, 2017

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Dec 14, 2017

sessionStorage is tab-local, so new browser tabs opened from manageiq now immediately log off (since we started logging off on API authentication failures - #2715)

To fix this, moving miq_token to localStorage which is persistent.

(Note: this also means the token won't be forgotten on closing the tab, and may still be used until it expires on the backend, there should be no change in visibility though.)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1528326

Cc @martinpovolny, @abellotti


Testing:

  1. log in to manageiq
  2. open a menu link in a new tab

Before:

the new tab immediately goes to the login screen

After:

the link is opened in the new tab

sessionStorage is tab-local, so new browser tabs opened from manageiq now immediately log off (since we started logging off on API authentication failures)

To fix this, moving `miq_token` to `localStorage` which is persistent.

(Note: this also means the token won't be forgotten on closing the tab, and may still be used until it expires on the backend.)
@miq-bot
Copy link
Member

miq-bot commented Dec 14, 2017

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/8b4a336873d8362bb683adc1f31fdf0c68533c37 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 1 offense detected

app/controllers/dashboard_controller.rb

@himdel
Copy link
Contributor Author

himdel commented Dec 21, 2017

@miq-bot remove_label bugzilla needed

Created https://bugzilla.redhat.com/show_bug.cgi?id=1528326

@dclarizio
Copy link

Verified this fixes the issue in the UI.

@dclarizio dclarizio merged commit 1461256 into ManageIQ:master Dec 21, 2017
@dclarizio dclarizio added this to the Sprint 76 Ending Jan 1, 2018 milestone Dec 21, 2017
@himdel himdel deleted the localStorage branch December 22, 2017 10:04
simaishi pushed a commit that referenced this pull request Jan 3, 2018
miq_token - move API auth from sessionStorage to localStorage
(cherry picked from commit 1461256)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530783
@simaishi
Copy link
Contributor

simaishi commented Jan 3, 2018

Gaprindashvili backport details:

$ git log -1
commit 10fd03770fd3e338c1406d8a45adb25211a485cb
Author: Dan Clarizio <dclarizi@redhat.com>
Date:   Thu Dec 21 08:34:30 2017 -0800

    Merge pull request #3065 from himdel/localStorage
    
    miq_token - move API auth from sessionStorage to localStorage
    (cherry picked from commit 14612564a2591dfc9536adac4d62b1d31d230bc4)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants