mirror of
https://github.com/thomiceli/opengist
synced 2024-11-08 12:55:50 +01:00
Change redirections when not logged in
This commit is contained in:
parent
ab59d7956a
commit
51dadcecef
@ -300,7 +300,7 @@ func logged(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
if user != nil {
|
||||
return next(ctx)
|
||||
}
|
||||
return redirect(ctx, "/all")
|
||||
return redirect(ctx, "/login")
|
||||
}
|
||||
}
|
||||
|
||||
|
4
templates/base/base_header.html
vendored
4
templates/base/base_header.html
vendored
@ -43,8 +43,8 @@
|
||||
<div class="hidden sm:block sm:ml-6">
|
||||
<div class="flex space-x-4">
|
||||
<a href="/all" class="text-slate-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium" aria-current="page">All</a>
|
||||
{{ if .userLogged }}
|
||||
<a href="/" class="text-slate-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">New</a>
|
||||
{{ if .userLogged }}
|
||||
<a href="/{{ .userLogged.Username }}" class="text-slate-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">My gists</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
@ -85,8 +85,8 @@
|
||||
<div class="sm:hidden hidden" id="mobile-menu">
|
||||
<div class="px-2 pt-2 pb-3 space-y-1">
|
||||
<a href="/all" class="bg-gray-900 text-white block px-3 py-2 rounded-md text-base font-medium" aria-current="page">All</a>
|
||||
{{ if .userLogged }}
|
||||
<a href="/" class="text-slate-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">New</a>
|
||||
{{ if .userLogged }}
|
||||
<a href="/{{ .userLogged.Username }}" class="text-slate-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">My gists</a>
|
||||
<a href="/settings" class="text-slate-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">Settings</a>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user