22 lines
655 B
Go
22 lines
655 B
Go
package auth
|
|
|
|
import (
|
|
|
|
"github.com/alexedwards/scs/v2"
|
|
"golang.org/x/crypto/bcrypt"
|
|
)
|
|
|
|
// remember, if anyone attempts to login as the system or zombie user, fail them. hard.
|
|
|
|
// sessionManager needs to be figured out. do i inherit that from somewhere else?
|
|
// does it get associated with any other one like PHP's `session_open()` if i call it here?
|
|
|
|
|
|
func set(writer http.ResponseWriter, request *http.Request) {
|
|
sessionManager.Put(request.Context(), "sessionKey", "message to be passed around")
|
|
}
|
|
|
|
func get(writer http.ResponseWriter, request *http.Request) String {
|
|
return sessionManager.GetString(request.Context(), "sessionKey")
|
|
}
|