session

package
v3.13.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 11 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 Store
}

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

func (s *Session) Get(c echo.Context) (*ttnpb.UserSession, error)

Get retrieves the current session.

func (*Session) GetUser

func (s *Session) GetUser(c echo.Context) (*ttnpb.User, error)

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

func (*Session) RemoveAuthCookie

func (s *Session) RemoveAuthCookie(c echo.Context)

RemoveAuthCookie deletes the authentication cookie.

func (*Session) UpdateAuthCookie

func (s *Session) UpdateAuthCookie(c echo.Context, 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.

Jump to

Keyboard shortcuts

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