Behaviours: cowboy_http_handler.
state() = #state{}
execute_or_error/5* | redirect to the provider for login or trigger the plugin. |
get_return_url/2* | return the url to use on fail/success of plugin execution. |
handle/2 | start a session if jwt parsing succeeded and get a queue entry, else retrun back. |
handle_queue_result/2* | handle the toke or error of requesting the queue. |
init/3 | init the request handling, does nothing. |
maybe_handle/3* | maybe handle the request, if there are not too many per second. |
redirect_to_provider/4* | redirect the a provider for login. |
request_queue_if_configured/2* | request a token at the queue if needed. |
set_cookie/2* | set the cookie for session. |
setup_session_and_start/3* | check the parsing result and maybe start the session and trigger the needed action. |
terminate/3 | on termination do nothing. |
warning/2* | log a warning. |
execute_or_error(X1::watts_rsp:request_type() | {error, Reason::atom()}, Session::pid(), Rsp::watts_rsp:rsp(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}
redirect to the provider for login or trigger the plugin
get_return_url(X1::{ok, any()} | any(), Rsp::watts_rsp:rsp()) -> binary()
return the url to use on fail/success of plugin execution
handle(Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}
start a session if jwt parsing succeeded and get a queue entry, else retrun back
handle the toke or error of requesting the queue
init(Type::any(), Req::cowboy_req:req(), Opts::any()) -> {ok, cowboy_req:req(), state()}
init the request handling, does nothing
maybe_handle(X1::boolean(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}
maybe handle the request, if there are not too many per second.
redirect_to_provider(Session::pid(), Rsp::watts_rsp:rsp(), Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}
redirect the a provider for login
request a token at the queue if needed.
set_cookie(Session::pid(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}
set the cookie for session.
setup_session_and_start(X1::{ok, watts_rsp:rsp()} | {error, any(), binary()}, Req::cowboy_req:req(), State::state()) -> {ok, cowboy_req:req(), state()}
check the parsing result and maybe start the session and trigger the needed action.
terminate(Reason::any(), Req::cowboy_req:req(), State::state()) -> ok
on termination do nothing
warning(Msg::string() | binary(), Params::[any()]) -> ok
log a warning
Generated by EDoc