feat(integrations): verify a credentials after saving them to db
This commit is contained in:
parent
eb7e7de463
commit
24e8e018e5
1 changed files with 5 additions and 0 deletions
|
|
@ -53,6 +53,11 @@ func (s *serviceImpl) AddIntegration(projectID uint64, provider string, data int
|
|||
if err := s.conn.Exec(sql, projectID, provider, data); err != nil {
|
||||
return fmt.Errorf("failed to add integration: %v", err)
|
||||
}
|
||||
// Check that provided credentials are valid
|
||||
_, err := s.fetchSessionData(provider, data, 0)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to validate provider credentials: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue