summaryrefslogtreecommitdiff
path: root/internal/discovery/discovery.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-09-06 16:54:50 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-09-06 16:54:50 +0200
commit40f8ecb5bf827e6ef071a47f5b6e33bba024e5f7 (patch)
tree1420b353811703d3790e7f7e9288f4afc09399ca /internal/discovery/discovery.go
parent0c3496ac6833416c600cf73569842595ff305cdc (diff)
Discovery: Make orgID not exists error closer to the specification
Diffstat (limited to 'internal/discovery/discovery.go')
-rw-r--r--internal/discovery/discovery.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index 415c71a..3ab13b3 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -67,6 +67,7 @@ func getDiscoFile(jsonFile string, previousVersion uint64, structure interface{}
// - [IMPLEMENTED] on "first launch" when offering the search for "Institute Access" and "Organizations";
// - [TODO] when the user tries to add new server AND the user did NOT yet choose an organization before;
// - [TODO] when the authorization for the server associated with an already chosen organization is triggered, e.g. after expiry or revocation.
+// - [IMPLEMENTED using a custom error message] NOTE: when the org_id that the user chose previously is no longer available in organization_list.json the application should ask the user to choose their organization (again). This can occur for example when the organization replaced their identity provider, uses a different domain after rebranding or simply ceased to exist.
func (discovery *Discovery) DetermineOrganizationsUpdate() bool {
return discovery.Organizations.Timestamp.IsZero()
}
@@ -205,7 +206,7 @@ type GetOrgByIDNotFoundError struct {
}
func (e GetOrgByIDNotFoundError) Error() string {
- return fmt.Sprintf("No Secure Internet Home found in organizations with ID %s", e.ID)
+ return fmt.Sprintf("No Secure Internet Home found in organizations with ID %s. Please choose your server again", e.ID)
}
type GetServerByURLNotFoundError struct {
@@ -215,7 +216,7 @@ type GetServerByURLNotFoundError struct {
func (e GetServerByURLNotFoundError) Error() string {
return fmt.Sprintf(
- "No institute access server found in organizations with URL %s and type %s",
+ "No institute access server found in organizations with URL %s and type %s. Please choose your server again",
e.URL,
e.Type,
)
@@ -239,5 +240,5 @@ type GetSecureHomeArgsNotFoundError struct {
}
func (e GetSecureHomeArgsNotFoundError) Error() string {
- return fmt.Sprintf("No Secure Internet Home found with URL: %s", e.URL)
+ return fmt.Sprintf("No Secure Internet Home found with URL: %s. Please choose your server again", e.URL)
}