diff options
| author | Bobby <[email protected]> | 2026-02-11 14:02:58 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-02-11 14:02:58 +0530 |
| commit | d87e08e0fc5911b2ff40604944448e1f0aaa31b7 (patch) | |
| tree | d64dba5b796ad39cb0514293cfd29826b66b8c7c /controllers/auth.go | |
| parent | 2c567dd96712a887b42cf4df3bdaa9f5f2b51a43 (diff) | |
| download | cafe-d87e08e0fc5911b2ff40604944448e1f0aaa31b7.tar.xz cafe-d87e08e0fc5911b2ff40604944448e1f0aaa31b7.zip | |
Implement authentication flow with middleware and controllers, add OpenID discovery URL to server config
Diffstat (limited to 'controllers/auth.go')
| -rw-r--r-- | controllers/auth.go | 19 |
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) +} |
