Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
8a8aa812
Commit
8a8aa812
authored
Mar 23, 2014
by
Stephane Glondu
Browse files
Auth_cas: factorize URL computation
parent
312bd62a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/web/auth_cas.ml
View file @
8a8aa812
...
...
@@ -59,6 +59,9 @@ module Make (C : CONFIG) (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_IN
let
service
=
Eliom_service
.
preapply
login_cas
None
let
self
=
Eliom_uri
.
make_string_uri
~
absolute
:
true
~
service
()
|>
rewrite_prefix
let
on_success_ref
=
Eliom_reference
.
eref
~
scope
:
Eliom_common
.
default_session_scope
(
fun
~
user_name
~
user_logout
->
Lwt
.
return
()
)
...
...
@@ -68,12 +71,8 @@ module Make (C : CONFIG) (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_IN
(
fun
ticket
()
->
match
ticket
with
|
Some
x
->
let
me
=
let
uri
=
Eliom_uri
.
make_string_uri
~
absolute
:
true
~
service
()
in
rewrite_prefix
uri
in
let
validation
=
let
service
=
Eliom_service
.
preapply
cas_validate
(
me
,
x
)
in
let
service
=
Eliom_service
.
preapply
cas_validate
(
self
,
x
)
in
Eliom_uri
.
make_string_uri
~
absolute
:
true
~
service
()
in
lwt
reply
=
Ocsigen_http_client
.
get_url
validation
in
...
...
@@ -111,10 +110,7 @@ module Make (C : CONFIG) (N : NAME) (S : CONT_SERVICE) (T : TEMPLATES) : AUTH_IN
)
|
None
->
fail_http
502
)
|
None
->
let
uri
=
Eliom_uri
.
make_string_uri
~
absolute
:
true
~
service
()
in
let
uri
=
rewrite_prefix
uri
in
Lwt
.
return
(
Eliom_service
.
preapply
cas_login
uri
)
|
None
->
Lwt
.
return
(
Eliom_service
.
preapply
cas_login
self
)
)
let
handler
~
on_success
()
=
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment