Files
relayer/extra.go
2023-06-26 20:05:06 -03:00

14 lines
264 B
Go

package relayer
import "context"
const AUTH_CONTEXT_KEY = iota
func GetAuthStatus(ctx context.Context) (pubkey string, ok bool) {
authedPubkey := ctx.Value(AUTH_CONTEXT_KEY)
if authedPubkey == nil {
return "", false
}
return authedPubkey.(string), true
}