mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
18 lines
297 B
Go
18 lines
297 B
Go
|
package khatru
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
func GetConnection(ctx context.Context) *WebSocket {
|
||
|
return ctx.Value(WS_KEY).(*WebSocket)
|
||
|
}
|
||
|
|
||
|
func GetAuthed(ctx context.Context) string {
|
||
|
authedPubkey := ctx.Value(AUTH_CONTEXT_KEY)
|
||
|
if authedPubkey == nil {
|
||
|
return ""
|
||
|
}
|
||
|
return authedPubkey.(string)
|
||
|
}
|