tsk-20: Obtain refresh token (#24)
Closes #20 Reviewed-on: phoenix/textsender-auth#24 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -84,3 +84,20 @@ func (m *MockServiceUserStore) GetWithUsername(ctx context.Context, username str
|
||||
return nil, fmt.Errorf("User not found")
|
||||
}
|
||||
}
|
||||
|
||||
func (m *MockServiceUserStore) GetWithId(ctx context.Context, id uuid.UUID) (*user.ServiceUser, error) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
if m.Error != nil {
|
||||
return nil, m.Error
|
||||
}
|
||||
|
||||
for _, serviceUser := range m.ServiceUsers {
|
||||
if serviceUser.Id == id {
|
||||
return serviceUser, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user