Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
32d4f41e
Commit
32d4f41e
authored
12 years ago
by
Shane Tomlinson
Browse files
Options
Downloads
Patches
Plain Diff
Generalize the logic for checking the redirect if authenticated paths.
parent
6f1f962d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/static/pages/js/start.js
+14
-12
14 additions, 12 deletions
resources/static/pages/js/start.js
with
14 additions
and
12 deletions
resources/static/pages/js/start.js
+
14
−
12
View file @
32d4f41e
...
...
@@ -18,7 +18,7 @@ $(function() {
xhr
=
bid
.
XHR
,
network
=
bid
.
Network
,
token
=
pageHelpers
.
getParameterByName
(
"
token
"
),
path
=
document
.
location
.
pathname
,
path
=
document
.
location
.
pathname
||
"
/
"
,
moduleManager
=
bid
.
module
,
modules
=
bid
.
Modules
,
CookieCheck
=
modules
.
CookieCheck
,
...
...
@@ -26,7 +26,8 @@ $(function() {
XHRDisableForm
=
modules
.
XHRDisableForm
,
Development
=
modules
.
Development
,
ANIMATION_TIME
=
500
,
checkCookiePaths
=
[
"
/signin
"
,
"
/signup
"
,
"
/forgot
"
,
"
/add_email_address
"
,
"
/confirm
"
,
"
/verify_email_address
"
];
checkCookiePaths
=
[
"
/signin
"
,
"
/forgot
"
,
"
/add_email_address
"
,
"
/confirm
"
,
"
/verify_email_address
"
],
redirectIfAuthenticatedPaths
=
[
"
/signin
"
,
"
/forgot
"
];
function
shouldCheckCookies
(
path
)
{
...
...
@@ -38,6 +39,7 @@ $(function() {
}
}
// Firefox and IE have rendering bugs where if the box-sizing is set to
// border-box and a min-height is set, padding is added on top of the
// min-height, making elements render using the normal W3C box model. Use
...
...
@@ -131,23 +133,23 @@ $(function() {
if
(
!
status
)
return
;
user
.
checkAuthentication
(
function
(
authenticated
)
{
if
(
!
path
||
path
===
"
/
"
)
{
// If the user is authenticated and the path should not be allowed if the
// user is authenticated, redirect them back to the main page. See issue
// #1345 https://github.com/mozilla/browserid/issues/1345
if
(
authenticated
&&
_
.
indexOf
(
redirectIfAuthenticatedPaths
,
path
)
>
-
1
)
{
document
.
location
=
"
/
"
;
return
;
}
else
if
(
path
===
"
/
"
)
{
bid
.
index
();
}
else
if
(
path
===
"
/signin
"
)
{
if
(
authenticated
)
{
document
.
location
=
"
/
"
;
return
;
}
var
module
=
bid
.
signIn
.
create
();
module
.
start
({});
}
else
if
(
path
===
"
/forgot
"
)
{
if
(
authenticated
)
{
document
.
location
=
"
/
"
;
return
;
}
bid
.
forgot
();
var
module
=
bid
.
forgot
.
create
();
module
.
start
({});
}
// START TRANSITION CODE
// add_email_address has been renamed to confirm. Once all outstanding
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment