Documentation
¶
Index ¶
- type UserRepository
- func (r *UserRepository) Create(ctx context.Context, user *models.User) error
- func (r *UserRepository) ExistsByEmail(ctx context.Context, email string) (bool, error)
- func (r *UserRepository) FindByEmail(ctx context.Context, email string) (*models.User, error)
- func (r *UserRepository) FindByID(ctx context.Context, id string) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func User ¶
func User(a app.App) *UserRepository
func (*UserRepository) ExistsByEmail ¶ added in v0.1.22
func (*UserRepository) FindByEmail ¶ added in v0.1.22
func (*UserRepository) FindByID ¶ added in v0.1.65
FindByID resolves the identifier a credential carries back to a row.
auth works in string ids — a JWT subject is a string, and UserProvider.GetID returns one — and this is the single place that knows the column behind it is a uint64.
An id that does not parse is a user that does not exist, not a failure. A credential issued before the identifier format changed, or a fabricated one, lands here; reporting it as an error would make auth answer 503, so on the day of an upgrade a wave of stale tokens would read as an outage instead of asking one person to sign in again.
Click to show internal directories.
Click to hide internal directories.