@@ -0,0 +1,22 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
var callbackRedirectMap map[string]string = make(map[string]string, 5)
|
||||
var callbackRedirectMutex sync.Mutex
|
||||
|
||||
func AddRedirect(state, url string) {
|
||||
callbackRedirectMutex.Lock()
|
||||
callbackRedirectMap[state] = url
|
||||
callbackRedirectMutex.Unlock()
|
||||
}
|
||||
|
||||
func GetRedirect(state string) string {
|
||||
callbackRedirectMutex.Lock()
|
||||
redirect := callbackRedirectMap[state]
|
||||
delete(callbackRedirectMap, state)
|
||||
callbackRedirectMutex.Unlock()
|
||||
return redirect
|
||||
}
|
||||
Reference in New Issue
Block a user