sso: expire tokens after usage

This commit is contained in:
Adhityaa Chandrasekar
2019-04-20 23:25:35 -04:00
parent fa2ccfe42e
commit 6317b384d9
6 changed files with 82 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ import (
"net/http"
)
func domainSsoNew(domain string) (string, error) {
func domainSsoSecretNew(domain string) (string, error) {
if domain == "" {
return "", errorMissingField
}
@@ -29,7 +29,7 @@ func domainSsoNew(domain string) (string, error) {
return ssoSecret, nil
}
func domainSsoNewHandler(w http.ResponseWriter, r *http.Request) {
func domainSsoSecretNewHandler(w http.ResponseWriter, r *http.Request) {
type request struct {
OwnerToken *string `json:"ownerToken"`
Domain *string `json:"domain"`
@@ -59,7 +59,7 @@ func domainSsoNewHandler(w http.ResponseWriter, r *http.Request) {
return
}
ssoSecret, err := domainSsoNew(domain)
ssoSecret, err := domainSsoSecretNew(domain)
if err != nil {
bodyMarshal(w, response{"success": false, "message": err.Error()})
return