/p>
<pre><code class="language-javascript">var isLoggedIn = false

var Login = {
    view: function() {
        return m(&quot;form&quot;, [
            m(&quot;button[type=button]&quot;, {
                onclick: function() {
                    isLoggedIn = true
                    m.route.set(&quot;/secret&quot;)
                }
            }, &quot;Login&quot;)
        ])
    }
}

m.route(document.body, &quot;/secret&quot;, {
    &quot;/secret&quot;: {
        onmatch: function() {
            if (!i