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
11
endpoint.go
11
endpoint.go
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue