request.execution_variable ("user")
if attached ws.request.cookie ({LOGIN_WITH_GITHUB_CONSTANTS}.oauth_user_login) as user then
Do something with user.string_representation
end
execute
local
l_github_service: LOGIN_WITH_GITHUB_SERVICE
s: STRING
do
execute_oauth_session_filter
if request.has_execution_variable ("user") then
-- Authenticated case
-- WebSocket URI /app I'm assuming you want to have access to the web socket only for authenticated users.
if request.path_info.same_string_general ("/app") then
s := websocket_app_html (request.server_name, request.server_port)
.....
end
--URI logout
if request.path_info.same_string_general ("/logout") then
handle_logout (request, response)
end
-- Other Authenticated cases.
else
-- Not Authenticated case
end
end
execute_oauth_session_filter
-- Filter the request to set the current user iff the oauth tokens exists.
do
if
attached {WSF_STRING} request.cookie (oauth_session_token) as l_roc_auth_session_token and then
attached {WSF_STRING} request.cookie (oauth_user_login) as l_user
then
request.set_execution_variable ("user", l_user.value)
end
end
if attached ws.request.cookie ({LOGIN_WITH_GITHUB_CONSTANTS}.oauth_user_login) as user then
-- Do something with user.string_representation
end
if attached ws.request.execution_variable ("user") as l_user then
end