Documentation ¶
Index ¶
- Constants
- Variables
- func Clear(ctx context.Context) error
- func FirebaseAuth(ctx context.Context, client *auth.Client, wallet string) (string, error)
- func FirebaseInit(ctx context.Context) (*auth.Client, error)
- func FirebaseVerify(ctx context.Context, client *auth.Client, sessionCookie string) error
- func IsAuthenticated(ctx context.Context, client *auth.Client) bool
- func Logger(nextHandler http.Handler) http.Handler
- func NewCookieStore(keyPairs ...[]byte) sessions.Store
- func Session(store sessions.Store) func(http.Handler) http.Handler
- func SetSiwe(ctx context.Context, message string) error
- func SetWalletAndToken(ctx context.Context, walletAddress string, jwtToken string) error
- func Siwe(ctx context.Context) (*siwe.Message, error)
- func Token(ctx context.Context) (string, error)
- func Wallet(ctx context.Context) (string, error)
- func WithStore(ctx context.Context, s sessions.Store, r *http.Request, w http.ResponseWriter) context.Context
- type SessionContext
Constants ¶
View Source
const Key = "session"
Variables ¶
View Source
var Store = NewCookieStore([]byte("session_secret"))
Functions ¶
func FirebaseAuth ¶
FirebaseAuth authenticate a user.
func FirebaseInit ¶
FirebaseInit returns a firebase auth client or an error if it fails.
func FirebaseVerify ¶
FirebaseVerify verifies whether the custom token exists and not expired.
func IsAuthenticated ¶
IsAuthenticated.
func NewCookieStore ¶
func SetWalletAndToken ¶
Store WalletAddress and JWT Token from firebase in session.
Types ¶
type SessionContext ¶
func SessionFor ¶
func SessionFor(ctx context.Context) SessionContext
Click to show internal directories.
Click to hide internal directories.