Skip to content

Commit

Permalink
fix(web): do not include session flows in non-acl mode
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Oct 10, 2022
1 parent 66d9776 commit e18e572
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/middleware/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const LoginPath = "/web/login"
func Session(store *session.Store, acl map[string][]string) fiber.Handler {
return func(c *fiber.Ctx) error {
if c.Path() == LoginPath || len(acl) == 0 {
_ = c.Bind(fiber.Map{"unprotected": true})
return c.Next()
}

Expand Down
8 changes: 5 additions & 3 deletions server/views/base.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="/static/style.css"/>
{% block head %}{% endblock %}
<style>
{% block style %}{% endblock %}
{% block style %}{% endblock %}
</style>

</head>
Expand All @@ -22,17 +22,19 @@

<header>
<div>
{% if authenticated %}
{% if authenticated or unprotected %}
<a href="/">Inca</a>
{% else %}
<span>Inca</span>
{% endif %}
</div>
<ul>
{% if authenticated %}
{% if authenticated or unprotected %}
<li><a href="/">home</a></li>
<li><a href="/web/config">config</a></li>
{% if not unprotected %}
<li><a href="/web/logout">logout</a></li>
{% endif %}
{% endif %}
</ul>
<hr/>
Expand Down

0 comments on commit e18e572

Please sign in to comment.