Files
relayer/extra.go
Yasuhiro Matsumoto 22490d2af5 fix auth
2025-03-28 22:51:04 +09:00

17 lines
299 B
Go

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