-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Redirect to login page when session ends #23783
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
Open
chippison
wants to merge
23
commits into
5.x-dev
Choose a base branch
from
ux-305
base: 5.x-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−1
Open
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ed32669
Adding a check on WidgetLoader.vue if response status is 401 (Unautho…
chippison b239e3c
making sure we add http response code to the returned exception or me…
chippison 16d0e63
adding 401 as part of status that we don't show error message on the …
chippison dfaf4d2
added rebuilt umd files
chippison b9f42bb
removed console logs
chippison f39b3be
Build vue files
innocraft-automation 817fe3a
Tidy up code
chippison 299e8ac
fixing changes in those dist folders
chippison b3085fb
adding new test for widgetloader that it redirects to new page if ses…
chippison ea2e07c
add new screenshot
chippison 6c2d364
adding a check that log in was successful by waiting for #dashboard t…
chippison 3b4a765
adding suggested change
chippison b26fa85
put back old code; we do not want to suppress the error message since…
chippison 2495716
moved force of http_response_code to Login Controller
chippison 1cc9e03
fixed up ui test so that it just clicks dashboard menu item instead o…
chippison 2dfafbc
Put back redirect to login page; seems to work properly now even w/o …
chippison 8132d36
redirecting back to the same page so that we can return back to the s…
chippison 8602d01
adding session expired text to translatable texts in CoreHome so that…
chippison 4697b81
changing test so we don't need to do screenshots and just do some DOM…
chippison 3efd269
deleting the screenshot that we no longer need
chippison 058f2a3
Update WidgetLoader to use refreshAfter instead of just plain redirect
chippison a91a324
Adding the change to AjaxHelper instead of WidgetLoader
chippison 1fc11d6
Merge branch '5.x-dev' into ux-305
chippison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /*! | ||
| * Matomo - free/libre analytics platform | ||
| * | ||
| * WidgetLoader screenshot tests. | ||
| * | ||
| * @link https://matomo.org | ||
| * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
| */ | ||
|
|
||
| describe('WidgetLoader', function () { | ||
| this.timeout(0); | ||
|
|
||
| this.fixture = "Piwik\\Tests\\Fixtures\\OneVisit"; | ||
|
|
||
| before(function () { | ||
| testEnvironment.testUseMockAuth = 0; | ||
| testEnvironment.save(); | ||
| }); | ||
|
|
||
| it('should redirect to the landing page when the session cookie is cleared during widget loading', async function () { | ||
| // We try to do an actual login | ||
| await page.goto(""); | ||
| await page.type("#login_form_login", superUserLogin); | ||
| await page.type("#login_form_password", superUserPassword); | ||
| await page.click('#login_form_submit'); | ||
| await page.waitForNetworkIdle(); | ||
|
|
||
| // check dashboard is shown | ||
| await page.waitForSelector('#dashboard'); | ||
| expect(await page.$('#dashboard')).to.be.ok; | ||
| await page.clearCookies(); | ||
|
|
||
| //Click on Dashboard menu item | ||
| const dashboardMenuSelector = 'div.reportingMenu ul li[data-category-id="Dashboard_Dashboard"] ul li:nth-child(1) a'; | ||
| await page.click(dashboardMenuSelector); | ||
| await page.waitForNetworkIdle(); | ||
|
|
||
| const loginForm = await page.waitForSelector('#login_form'); | ||
| expect(loginForm).to.be.ok; | ||
|
|
||
| const errorNotification = await page.waitForSelector('div.system.notification-error'); | ||
| expect(errorNotification).to.be.ok; | ||
|
|
||
| const errorText = await page.evaluate(() => _pk_translate('General_Error')); | ||
| const expectedErrorNotificationText = await page.evaluate(() => _pk_translate('General_YourSessionHasExpired')); | ||
| const expectedText = errorText + ': ' + expectedErrorNotificationText; | ||
| const notificationText = await page.$eval('div.system.notification-error .notification-body', el => el.textContent.trim()); | ||
| expect(notificationText).to.equal(expectedText); | ||
|
|
||
| }); | ||
| }); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.