aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/controller/sign-in.go
blob: e73d0c4c189f2bc9acd2c215497292b124bb5a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package controller

import (
	"projecty/internal/authentication"

	"github.com/gofiber/fiber/v2"
)

func SignInPage(c *fiber.Ctx) error {

	isAuthenticated, _ := authentication.AuthGet(c)
	if isAuthenticated {
		return c.Redirect("/")
	}

	return c.Render("sign-in/index", fiber.Map{
		"PageTitle":    "Sign In — Projecty",
		"FiberCtx":     c,
		"NavBarActive": "sign-in",
	}, "layouts/app")
}