15 lines
288 B
Go
15 lines
288 B
Go
package security
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"synlotto-website/internal/platform/sessionkeys"
|
|
|
|
"github.com/alexedwards/scs/v2"
|
|
)
|
|
|
|
func GetCurrentUserID(sm *scs.SessionManager, r *http.Request) (int, bool) {
|
|
userID := sm.GetInt(r.Context(), sessionkeys.UserID)
|
|
return userID, userID != 0
|
|
}
|