summaryrefslogtreecommitdiff
path: root/internal/server/instituteaccess.go
diff options
context:
space:
mode:
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