Files
outfit-voting-abi26/internal/auth/redirect.go
T
tueem 85e4df52a5
build / Go-Build (push) Successful in 1m1s
feat(*): initial commit
2026-06-24 00:16:21 +02:00

23 lines
477 B
Go

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
}