Documentation ¶
Index ¶
- Variables
- func CreateAuthToken(user string) (string, error)
- func GenerateHashString() (string, error)
- func HasValidAuthToken(v string) bool
- func SendAuthEmail(recipient string, authHash, redirectURL string) error
- type AuthClaims
- type MagicLinkAuth
- func (m *MagicLinkAuth) AuthHandler(w http.ResponseWriter, r *http.Request)
- func (m *MagicLinkAuth) IsAuthenticated(f http.HandlerFunc) http.HandlerFunc
- func (m *MagicLinkAuth) LoginHandler(w http.ResponseWriter, r *http.Request)
- func (m *MagicLinkAuth) MagicLinkHandler(w http.ResponseWriter, r *http.Request)
- func (m *MagicLinkAuth) ProtectedHandler(w http.ResponseWriter, r *http.Request)
- func (m *MagicLinkAuth) SaveMagicString(email string, hash string) error
- func (m *MagicLinkAuth) UnauthenticatedHandler(w http.ResponseWriter, r *http.Request)
- type Sender
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SMTP_SERVER = os.Getenv("SMTP_SERVER")
)
Functions ¶
func CreateAuthToken ¶
func GenerateHashString ¶
func HasValidAuthToken ¶
func SendAuthEmail ¶
Types ¶
type AuthClaims ¶
type AuthClaims struct { User string `json:"user"` jwt.StandardClaims }
type MagicLinkAuth ¶
type MagicLinkAuth struct {
// contains filtered or unexported fields
}
func NewMagicLinkAuth ¶
func NewMagicLinkAuth(db *bitcask.Bitcask) (*MagicLinkAuth, error)
func (*MagicLinkAuth) AuthHandler ¶
func (m *MagicLinkAuth) AuthHandler(w http.ResponseWriter, r *http.Request)
func (*MagicLinkAuth) IsAuthenticated ¶
func (m *MagicLinkAuth) IsAuthenticated(f http.HandlerFunc) http.HandlerFunc
func (*MagicLinkAuth) LoginHandler ¶
func (m *MagicLinkAuth) LoginHandler(w http.ResponseWriter, r *http.Request)
func (*MagicLinkAuth) MagicLinkHandler ¶
func (m *MagicLinkAuth) MagicLinkHandler(w http.ResponseWriter, r *http.Request)
func (*MagicLinkAuth) ProtectedHandler ¶
func (m *MagicLinkAuth) ProtectedHandler(w http.ResponseWriter, r *http.Request)
func (*MagicLinkAuth) SaveMagicString ¶
func (m *MagicLinkAuth) SaveMagicString(email string, hash string) error
func (*MagicLinkAuth) UnauthenticatedHandler ¶
func (m *MagicLinkAuth) UnauthenticatedHandler(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.