-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamelinium.web.controller.html
36 lines (36 loc) · 27.7 KB
/
amelinium.web.controller.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>amelinium.web.controller documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Amelinium</span> <span class="project-version">1.0.1</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li><li class="depth-1 "><a href="20_hypermedia.html"><div class="inner"><span>Hypermedia-driven</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="amelinium.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>amelinium</span></div></a></li><li class="depth-2 branch"><a href="amelinium.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-2"><a href="amelinium.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-3"><a href="amelinium.api.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4"><a href="amelinium.api.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3"><a href="amelinium.api.url.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>url</span></div></a></li><li class="depth-2 branch"><a href="amelinium.app.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>app</span></div></a></li><li class="depth-2"><a href="amelinium.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>algo</span></div></div></li><li class="depth-4 branch"><a href="amelinium.auth.algo.append.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>append</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.fail.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>fail</span></div></a></li><li class="depth-4 branch"><a href="amelinium.auth.algo.pbkdf2.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pbkdf2</span></div></a></li><li class="depth-4"><a href="amelinium.auth.algo.scrypt.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>scrypt</span></div></a></li><li class="depth-3 branch"><a href="amelinium.auth.pwd.html"><div class="inner"><span class="tree" style="top: -145px;"><span class="top" style="height: 154px;"></span><span class="bottom"></span></span><span>pwd</span></div></a></li><li class="depth-3"><a href="amelinium.auth.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-2"><a href="amelinium.common.html"><div class="inner"><span class="tree" style="top: -238px;"><span class="top" style="height: 247px;"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-3"><a href="amelinium.common.oplog.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>oplog</span></div></a></li><li class="depth-4"><a href="amelinium.common.oplog.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.common.populators.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-3"><a href="amelinium.common.swagger.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>swagger</span></div></a></li><li class="depth-2 branch"><a href="amelinium.core.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="amelinium.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3"><a href="amelinium.db.sql.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sql</span></div></a></li><li class="depth-2 branch"><a href="amelinium.errors.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-2"><a href="amelinium.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></div></li><li class="depth-4"><a href="amelinium.http.client.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.handler.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>handler</span></div></a></li><li class="depth-3"><a href="amelinium.http.middleware.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>middleware</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.coercion.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>coercion</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.content.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>content</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.debug.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>debug</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.format.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>format</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.headers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>headers</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.language.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>language</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.lazy-req.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>lazy-req</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.populators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>populators</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.remote-ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>remote-ip</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.roles.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>roles</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.middleware.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-4"><a href="amelinium.http.middleware.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-3 branch"><a href="amelinium.http.router.html"><div class="inner"><span class="tree" style="top: -424px;"><span class="top" style="height: 433px;"></span><span class="bottom"></span></span><span>router</span></div></a></li><li class="depth-3"><a href="amelinium.http.server.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></a></li><li class="depth-4 branch"><a href="amelinium.http.server.jetty.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>jetty</span></div></a></li><li class="depth-4"><a href="amelinium.http.server.undertow.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>undertow</span></div></a></li><li class="depth-2"><a href="amelinium.i18n.html"><div class="inner"><span class="tree" style="top: -672px;"><span class="top" style="height: 681px;"></span><span class="bottom"></span></span><span>i18n</span></div></a></li><li class="depth-3"><a href="amelinium.i18n.pluralizers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>pluralizers</span></div></a></li><li class="depth-2 branch"><a href="amelinium.identity.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-2 branch"><a href="amelinium.locale.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>locale</span></div></a></li><li class="depth-2 branch"><a href="amelinium.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>model</span></div></div></li><li class="depth-3 branch"><a href="amelinium.model.confirmation.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>confirmation</span></div></a></li><li class="depth-3"><a href="amelinium.model.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>proto</span></div></div></li><li class="depth-3 branch"><a href="amelinium.proto.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.proto.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.proto.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.schemas.html"><div class="inner"><span class="tree" style="top: -176px;"><span class="top" style="height: 185px;"></span><span class="bottom"></span></span><span>schemas</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>server</span></div></div></li><li class="depth-3"><a href="amelinium.server.ssl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ssl</span></div></a></li><li class="depth-2 branch"><a href="amelinium.system.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>system</span></div></a></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></div></li><li class="depth-3 branch"><a href="amelinium.types.auth.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>auth</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.errors.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>errors</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.identity.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>identity</span></div></a></li><li class="depth-3 branch"><a href="amelinium.types.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3"><a href="amelinium.types.twilio.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>twilio</span></div></a></li><li class="depth-2 branch"><a href="amelinium.utils.html"><div class="inner"><span class="tree" style="top: -207px;"><span class="top" style="height: 216px;"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-2"><a href="amelinium.web.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>web</span></div></a></li><li class="depth-3 current"><a href="amelinium.web.controller.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>controller</span></div></a></li><li class="depth-4 branch"><a href="amelinium.web.controller.admin.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>admin</span></div></a></li><li class="depth-4"><a href="amelinium.web.controller.user.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>user</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.js.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>js</span></div></a></li><li class="depth-3 branch"><a href="amelinium.web.taggers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>taggers</span></div></a></li><li class="depth-3"><a href="amelinium.web.url.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>url</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="amelinium.web.controller.html#var-cleanup-req"><div class="inner"><span>cleanup-req</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-default"><div class="inner"><span>default</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-handle-coercion-error"><div class="inner"><span>handle-coercion-error</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-inject-goto"><div class="inner"><span>inject-goto</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-login-data.3F"><div class="inner"><span>login-data?</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-populate-goto"><div class="inner"><span>populate-goto</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-prep-request.21"><div class="inner"><span>prep-request!</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-remove-login-data"><div class="inner"><span>remove-login-data</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-render.21"><div class="inner"><span>render!</span></div></a></li><li class="depth-1"><a href="amelinium.web.controller.html#var-saved-params"><div class="inner"><span>saved-params</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">amelinium.web.controller</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>amelinium service, common web controller functions.</p>
</div></div><div class="public anchor" id="var-cleanup-req"><h3>cleanup-req</h3><div class="usage"><code>(cleanup-req req [_ auth?])</code></div><div class="doc"><div class="markdown"><p>Removes login data from <code>req</code> if we are on authentication page.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L62">view source</a></div></div><div class="public anchor" id="var-default"><h3>default</h3><div class="usage"><code>(default req)</code></div><div class="doc"><div class="markdown"></div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L294">view source</a></div></div><div class="public anchor" id="var-handle-coercion-error"><h3>handle-coercion-error</h3><div class="usage"><code>(handle-coercion-error e respond raise)</code><code>(handle-coercion-error e respond raise session-key)</code></div><div class="doc"><div class="markdown"><p>Called when coercion exception is thrown by the handler executed earlier in a middleware chain. Takes an exception object <code>e</code>, response wrapper <code>respond</code>, and a <code>raise</code> function.</p>
<p>When coercion error is detected during request processing, it creates a map (by calling the <code>amelinium.http.middleware.coercion/map-errors-simple</code>) containing parameter identifiers associated with parameter types (or with <code>nil</code> values if type information is not available).</p>
<p>If there is a session then this map is stored in a session variable <code>:form-errors</code> under the <code>:errors</code> key (additionally, there is a <code>:dest</code> key identifying a path of the current page).</p>
<p>If there is no valid session or a session variable cannot be stored, the result is serialized as a query string parameter <code>form-errors</code> with erroneous fields separated by commas.</p>
<p>If type name is available then a string in a form of <code>parameter:type</code> is generated.</p>
<p>If type name is not available, a simple parameter name is generated. So the example value (before encoding) may look like <code>email,secret:password</code> (<code>email</code> being a parameter without type information, <code>secret</code> being a parameter with type named <code>password</code>).</p>
<p>Next, the originating URI is obtained from the <code>Referer</code> header and a temporary redirect (with HTTP code 307) is generated with this path and a query string containing <code>form-errors</code> parameter. The value of the parameter is empty if form errors were saved in a session variable.</p>
<p>The destination of the redirect can be overriden by the <code>:form-errors/page</code> configuration option associated with HTTP route data.</p>
<p>If the destination URI cannot be established, or if a coercion error happened during handling some previous coercion error (so the current page is where the browser had been redirected to), then instead of generating a redirect, a regular page is rendered with HTTP code of 422. The <code>:app/data</code> key of a request map is updated with:</p>
<ul>
<li><code>:title</code> set to a translated message of <code>:parameters/error</code>,</li>
<li><code>:form/errors</code> containing a map:</li>
<li><code>:errors</code> mapped to <code>amelinium.http.middleware.coercion/map-errors-simple</code> applied to <code>errors</code>,</li>
<li><code>:params</code> mapped to a map containing current parameter values from coercion data,</li>
<li><code>:dest</code> mapped to a destination URI;</li>
<li><code>:coercion/errors</code> (result of <code>amelinium.http.middleware.coercion/explain-errors-simple</code> applied to coercion data).</li>
</ul>
<p>When a coercion error is detected during response processing, a web page of HTTP code 500 is rendered. The <code>:app/data</code> key of a request map is updated with the:</p>
<ul>
<li><code>:title</code> (translated message of <code>:output/error</code>),</li>
<li><code>:form/errors</code> (result of <code>amelinium.http.middleware.coercion/explain-errors-simple</code>).</li>
</ul>
<p>Please note that if error is detected in a nested structure of parameter’s value, the whole parameter will be reported as bad.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L301">view source</a></div></div><div class="public anchor" id="var-inject-goto"><h3>inject-goto</h3><div class="usage"><code>(inject-goto req gmap)</code><code>(inject-goto req gmap smap)</code></div><div class="doc"><div class="markdown"><p>Injects go-to data (<code>gmap</code>) into a request map <code>req</code> (affected, form-related keys are: <code>:form-params</code>, <code>:query-params</code> and <code>:params</code>; affected, header-related key is <code>referer</code>). Form data is merged only if a go-to URI (<code>:uri</code> key of <code>gmap</code>) matches the URI of a current page. Go-to URI is always injected. When the given <code>gmap</code> is broken, it will set <code>:goto-injected?</code> to <code>true</code> but <code>:goto-uri</code> and <code>:goto</code> to <code>false</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L67">view source</a></div></div><div class="public anchor" id="var-login-data.3F"><h3>login-data?</h3><div class="usage"><code>(login-data? req)</code></div><div class="doc"><div class="markdown"><p>Returns true if <code>:form-params</code> map of a request map <code>req</code> contains login data.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L112">view source</a></div></div><div class="public anchor" id="var-populate-goto"><h3>populate-goto</h3><div class="usage"><code>(populate-goto req smap)</code></div><div class="doc"><div class="markdown"><p>Gets a go-to data from a session variable if it does not yet exist in the <code>req</code> context. Works also for the expired session and only if a go-to URI (<code>:uri</code> key of a map) is the same as the URI of a currently visited page. Uses <code>inject-goto</code> to inject the data.</p>
<p>Go-to data will not be populated (or even tried) if there is no session, or is there is already a value associated with the <code>:goto-injected</code> key, or form params does not contain <code>am/goto</code> parameter of any value (even an empty string or <code>nil</code>).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L122">view source</a></div></div><div class="public anchor" id="var-prep-request.21"><h3>prep-request!</h3><div class="usage"><code>(prep-request! req)</code><code>(prep-request! req session-key)</code></div><div class="doc"><div class="markdown"><p>Prepares a request before any web controller is called.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L144">view source</a></div></div><div class="public anchor" id="var-remove-login-data"><h3>remove-login-data</h3><div class="usage"><code>(remove-login-data req)</code></div><div class="doc"><div class="markdown"><p>Removes login data from the form params part of a request map.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L57">view source</a></div></div><div class="public anchor" id="var-render.21"><h3>render!</h3><div class="usage"><code>(render! req)</code><code>(render! req status-or-fn)</code></div><div class="doc"><div class="markdown"><p>Renders page after a specific web controller was called. The <code>:app/view</code> and <code>:app/layout</code> keys are added to the request data by controllers to indicate which view and layout file should be used. Data passed to the template system is populated with common keys which should be present in <code>:app/data</code>. If the <code>:response/fn</code> is set then it will be used instead of <code>web/render-ok</code> to render an HTML response.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L274">view source</a></div></div><div class="public anchor" id="var-saved-params"><h3>saved-params</h3><div class="usage"><code>(saved-params req gmap)</code><code>(saved-params req gmap smap)</code><code>(saved-params req gmap smap session-key)</code></div><div class="doc"><div class="markdown"><p>Gets go-to data for a valid (and not expired) session. Returns data as a map. The resulting map has, among form data, <code>:session-id</code> entry removed (if found) but <code>:ref-uri</code>, <code>:page</code> and other entries kept.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/amelinium/tree/1.0.1/src/amelinium/web/controller.clj#L38">view source</a></div></div></div></body></html>