summaryrefslogtreecommitdiff
path: root/internal/server/instituteaccess.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-24 14:37:05 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-24 14:37:05 +0200
commit03f0fc68168de8db1735cc7d1c4d328c4bdd03f2 (patch)
tree53218a27cbfbfccf8fb792835e31f28d36aadbfa /internal/server/instituteaccess.go
parentfea086334359e715ee388e01c4a4a00f5f379fe4 (diff)
State + Server + Exports: Implement removing a server
Diffstat (limited to 'internal/server/instituteaccess.go')
-rw-r--r--internal/server/instituteaccess.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go
index 6ac248d..e948480 100644
--- a/internal/server/instituteaccess.go
+++ b/internal/server/instituteaccess.go
@@ -22,6 +22,20 @@ type InstituteAccessServers struct {
CurrentURL string `json:"current_url"`
}
+func (servers *Servers) RemoveInstituteAccess(url string) {
+ servers.InstituteServers.Remove(url)
+}
+
+func (servers *InstituteAccessServers) Remove(url string) {
+ // Reset the current url
+ if servers.CurrentURL == url {
+ servers.CurrentURL = ""
+ }
+
+ // Delete the url from the map
+ delete(servers.Map, url)
+}
+
// For an institute, we can simply get the OAuth
func (institute *InstituteAccessServer) GetOAuth() *oauth.OAuth {
return &institute.OAuth