Documentation ¶
Index ¶
- Variables
- type Data
- type Id
- type LoginMetadata
- type Manager
- type OtherSessionsDetails
- type PublicData
- type Session
- func (s *Session) CheckIsLoggedIn() error
- func (s *Session) Destroy(ctx context.Context) error
- func (s *Session) DestroyOthers(ctx context.Context, d *OtherSessionsDetails) error
- func (s *Session) GetOthers(ctx context.Context) (*OtherSessionsDetails, error)
- func (s *Session) IsLoggedIn() bool
- func (s *Session) Login(ctx context.Context, u user.ForSession, ip string) (string, error)
- func (s *Session) PrepareLogin(ctx context.Context, u user.ForSession, ip string) (string, func(), error)
- func (s *Session) Save(ctx context.Context) (bool, error)
- func (s *Session) Touch(ctx context.Context) error
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotLoggedIn = &errors.UnauthorizedError{Reason: "not logged in"}
View Source
var ErrRedisConnectionDeSync = errors.New("redis connection de-synced")
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { AnonTokenAccess anonTokenAccess `json:"ata,omitempty"` PasswordResetToken oneTimeToken.OneTimeToken `json:"rt,omitempty"` PostLoginRedirect string `json:"plr,omitempty"` LoginMetadata *LoginMetadata `json:"lm,omitempty"` PublicData }
func (*Data) AddAnonTokenAccess ¶
func (d *Data) AddAnonTokenAccess(projectId sharedTypes.UUID, token project.AccessToken)
func (*Data) GetAnonTokenAccess ¶
func (d *Data) GetAnonTokenAccess(projectId sharedTypes.UUID) project.AccessToken
type LoginMetadata ¶
type Manager ¶
type Manager interface { DestroyAllForUser(ctx context.Context, userId sharedTypes.UUID) error GetSession(c *httpUtils.Context) (*Session, error) GetOrCreateSession(c *httpUtils.Context) (*Session, error) GetSessionById(ctx context.Context, id Id) (*Session, error) Flush(c *httpUtils.Context, session *Session) error RequireLoggedInSession(c *httpUtils.Context) (*Session, error) TouchSession(c *httpUtils.Context, session *Session) }
func New ¶
func New(options signedCookie.Options, client redis.UniversalClient) Manager
type OtherSessionsDetails ¶
type OtherSessionsDetails struct { Sessions []LoginMetadata // contains filtered or unexported fields }
type PublicData ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) CheckIsLoggedIn ¶
func (*Session) DestroyOthers ¶
func (s *Session) DestroyOthers(ctx context.Context, d *OtherSessionsDetails) error
func (*Session) GetOthers ¶
func (s *Session) GetOthers(ctx context.Context) (*OtherSessionsDetails, error)
func (*Session) IsLoggedIn ¶
func (*Session) PrepareLogin ¶
type User ¶
type User struct { Email sharedTypes.Email `json:"e"` FirstName string `json:"f,omitempty"` Id sharedTypes.UUID `json:"i"` LastName string `json:"l,omitempty"` }
func (*User) ToPublicUserInfo ¶
func (u *User) ToPublicUserInfo() user.WithPublicInfo
Click to show internal directories.
Click to hide internal directories.