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

@ -167,7 +167,16 @@ func getRoot(w http.ResponseWriter, r *http.Request) {
errorCode := r.URL.Query().Get("error")
err = htmlSignin(w, errorCode)
} else {
err = htmlDashboard(w, user)
has, err := hasFieldseekerConnection(r.Context(), user)
if err != nil {
respondError(w, "Failed to check for ArcGIS connection", err, http.StatusInternalServerError)
return
}
if has {
err = htmlDashboard(w, user)
} else {
err = htmlOauthPrompt(w, user)
}
}
if err != nil {
respondError(w, "Failed to render root", err, http.StatusInternalServerError)