session

package
v3.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Store TransactionalStore
}

Session is the session helper.

func (*Session) DoLogin

func (s *Session) DoLogin(ctx context.Context, userID, password string) error

DoLogin performs the authentication using user id and password.

func (*Session) Get

Get retrieves the current session.

func (*Session) GetUser

func (s *Session) GetUser(w http.ResponseWriter, r *http.Request) (*http.Request, *ttnpb.User, error)

GetUser retrieves the user that is associated with the current session.

func (*Session) RemoveAuthCookie

func (s *Session) RemoveAuthCookie(w http.ResponseWriter, r *http.Request)

RemoveAuthCookie deletes the authentication cookie.

func (*Session) UpdateAuthCookie

func (s *Session) UpdateAuthCookie(w http.ResponseWriter, r *http.Request, update func(value *auth.CookieShape) error) error

UpdateAuthCookie updates the current authentication cookie.

type Store

type Store interface {
	// UserStore and UserSessionStore are needed for user login/logout.
	store.UserStore
	store.UserSessionStore
}

Store used by the account app server.

type TransactionalStore added in v3.21.0

type TransactionalStore interface {
	Store

	// Transact runs a transaction using the store.
	Transact(context.Context, func(context.Context, Store) error) error
}

TransactionalStore is Store, but with a method that uses a transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL