fix: preferred login name (#231)

* fix: add preferred login name to my user sessions and get user info from view

* fix: my user in auth
This commit is contained in:
Livio Amstutz
2020-06-17 16:43:53 +02:00
committed by GitHub
parent 4688543d07
commit e7b139ba2c
15 changed files with 1221 additions and 872 deletions

View File

@@ -64,6 +64,10 @@ func (repo *UserRepo) Register(ctx context.Context, registerUser *model.User, or
return usr_model.UserToModel(user), nil
}
func (repo *UserRepo) MyUser(ctx context.Context) (*model.UserView, error) {
return repo.UserByID(ctx, auth.GetCtxData(ctx).UserID)
}
func (repo *UserRepo) MyProfile(ctx context.Context) (*model.Profile, error) {
user, err := repo.UserByID(ctx, auth.GetCtxData(ctx).UserID)
if err != nil {