summaryrefslogtreecommitdiff
path: root/controllers/auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/auth.go')
-rw-r--r--controllers/auth.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/controllers/auth.go b/controllers/auth.go
new file mode 100644
index 0000000..2d8d89b
--- /dev/null
+++ b/controllers/auth.go
@@ -0,0 +1,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)
+}