Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
0b31223c
Commit
0b31223c
authored
9 years ago
by
Steven Hammerton
Browse files
Options
Downloads
Patches
Plain Diff
Updates to fallback CAS login to do new token login
parent
fece2f5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/static/client/login/js/login.js
+12
-26
12 additions, 26 deletions
synapse/static/client/login/js/login.js
with
12 additions
and
26 deletions
synapse/static/client/login/js/login.js
+
12
−
26
View file @
0b31223c
...
@@ -17,12 +17,11 @@ var submitPassword = function(user, pwd) {
...
@@ -17,12 +17,11 @@ var submitPassword = function(user, pwd) {
}).
error
(
errorFunc
);
}).
error
(
errorFunc
);
};
};
var
submit
Cas
=
function
(
ticket
,
service
)
{
var
submit
Token
=
function
(
loginToken
)
{
console
.
log
(
"
Logging in with
cas
...
"
);
console
.
log
(
"
Logging in with
login token
...
"
);
var
data
=
{
var
data
=
{
type
:
"
m.login.cas
"
,
type
:
"
m.login.token
"
,
ticket
:
ticket
,
token
:
loginToken
service
:
service
,
};
};
$
.
post
(
matrixLogin
.
endpoint
,
JSON
.
stringify
(
data
),
function
(
response
)
{
$
.
post
(
matrixLogin
.
endpoint
,
JSON
.
stringify
(
data
),
function
(
response
)
{
show_login
();
show_login
();
...
@@ -41,23 +40,10 @@ var errorFunc = function(err) {
...
@@ -41,23 +40,10 @@ var errorFunc = function(err) {
}
}
};
};
var
getCasURL
=
function
(
cb
)
{
$
.
get
(
matrixLogin
.
endpoint
+
"
/cas
"
,
function
(
response
)
{
var
cas_url
=
response
.
serverUrl
;
cb
(
cas_url
);
}).
error
(
errorFunc
);
};
var
gotoCas
=
function
()
{
var
gotoCas
=
function
()
{
getCasURL
(
function
(
cas_url
)
{
var
this_page
=
window
.
location
.
origin
+
window
.
location
.
pathname
;
var
this_page
=
window
.
location
.
origin
+
window
.
location
.
pathname
;
var
redirect_url
=
matrixLogin
.
endpoint
+
"
/cas/redirect?redirectUrl=
"
+
encodeURIComponent
(
this_page
);
window
.
location
.
replace
(
redirect_url
);
var
redirect_url
=
cas_url
+
"
/login?service=
"
+
encodeURIComponent
(
this_page
);
window
.
location
.
replace
(
redirect_url
);
});
}
}
var
setFeedbackString
=
function
(
text
)
{
var
setFeedbackString
=
function
(
text
)
{
...
@@ -111,7 +97,7 @@ var fetch_info = function(cb) {
...
@@ -111,7 +97,7 @@ var fetch_info = function(cb) {
matrixLogin
.
onLoad
=
function
()
{
matrixLogin
.
onLoad
=
function
()
{
fetch_info
(
function
()
{
fetch_info
(
function
()
{
if
(
!
try_
cas
())
{
if
(
!
try_
token
())
{
show_login
();
show_login
();
}
}
});
});
...
@@ -148,20 +134,20 @@ var parseQsFromUrl = function(query) {
...
@@ -148,20 +134,20 @@ var parseQsFromUrl = function(query) {
return
result
;
return
result
;
};
};
var
try_
cas
=
function
()
{
var
try_
token
=
function
()
{
var
pos
=
window
.
location
.
href
.
indexOf
(
"
?
"
);
var
pos
=
window
.
location
.
href
.
indexOf
(
"
?
"
);
if
(
pos
==
-
1
)
{
if
(
pos
==
-
1
)
{
return
false
;
return
false
;
}
}
var
qs
=
parseQsFromUrl
(
window
.
location
.
href
.
substr
(
pos
+
1
));
var
qs
=
parseQsFromUrl
(
window
.
location
.
href
.
substr
(
pos
+
1
));
var
tic
ke
t
=
qs
.
tic
ke
t
;
var
loginTo
ke
n
=
qs
.
loginTo
ke
n
;
if
(
!
tic
ke
t
)
{
if
(
!
loginTo
ke
n
)
{
return
false
;
return
false
;
}
}
submit
Cas
(
ticket
,
location
.
origi
n
);
submit
Token
(
loginToke
n
);
return
true
;
return
true
;
};
};
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