mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-27 10:12:54 +01:00
14 lines
264 B
Go
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
|
|
}
|