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:
Eli Ribble 2025-11-06 22:58:18 +00:00
parent fa89e0719f
commit 72cbe2de5e
No known key found for this signature in database
10 changed files with 567 additions and 100 deletions

View file

@ -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"
}