Skip to main content

monolith-auth-and-sessions

Use when implementing login/signup/logout, access control, and cookie-backed session logic in this Monolith app.

Jump to install

Source facts

Repository
cggonzal/monolith
Last source activity
February 14, 2026 at 03:11
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
monolith-auth-and-sessions
description
Use when implementing login/signup/logout, access control, and cookie-backed session logic in this Monolith app.
# Monolith Auth and Sessions ## Use this skill when - Adding authentication or protecting routes. - Reading/writing session values. ## Core components - Session package: `app/session/session.go` - Auth middleware and controller (generated by auth scaffold) - Config secret: `config.SECRET_KEY` ## Bootstrap auth Run: `make generator authentication` Scaffold includes: - `User` model - session helpers - auth middleware - auth controller - login/signup templates - routes for `/login`, `/signup`, `/logout` ## Session model - Session store is Gorilla cookie store. - Initialized once in `session.InitSession()`. - Standard keys include login flag and email. ## Route protection pattern Wrap handlers with login/admin middleware decorators. If user is anonymous, redirect to `/login`. ## Security notes - Always set `SECRET_KEY` in production. - Never trust only client-side state for authorization decisions. - Re-check privileges server-side in middleware.
View on GitHub