summaryrefslogtreecommitdiff
path: root/controllers/auth.go
blob: 2d8d89b87c33b25b86b21db582a81d260d548aa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package controllers

import (
	"cafe/utils/auth"
	"cafe/utils/meta"
	"cafe/utils/shortcuts"

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

func Authenticate(context *fiber.Ctx) error {
	if auth.IsAuthenticated(context) {
		return shortcuts.Redirect(context, "mainHall")
	}

	meta.SetPageTitle(context, "Open ID Authentication")

	return shortcuts.Render(context, "pages/auth", nil)
}