Check if we have oauth information, only prompt if its missing
Also include a rough dashboard of information that we'll pull from Fieldseeker
This commit is contained in:
parent
fa89e0719f
commit
72cbe2de5e
10 changed files with 567 additions and 100 deletions
|
|
@ -17,6 +17,7 @@ import (
|
|||
|
||||
"github.com/Gleipnir-Technology/arcgis-go"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/sql"
|
||||
"github.com/aarondl/opt/omit"
|
||||
)
|
||||
|
||||
|
|
@ -155,6 +156,13 @@ func handleOauthAccessCode(ctx context.Context, user *models.User, code string)
|
|||
return nil
|
||||
}
|
||||
|
||||
func hasFieldseekerConnection(ctx context.Context, user *models.User) (bool, error) {
|
||||
result, err := sql.OauthTokenByUserId(user.ID).All(ctx, PGInstance.BobDB)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return len(result) > 0, nil
|
||||
}
|
||||
func redirectURL() string {
|
||||
return BaseURL + "/arcgis/oauth/callback"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue