(ctx context.Context)
| 65 | ) |
| 66 | |
| 67 | func AuthSessionFrom(ctx context.Context) (Session, bool) { |
| 68 | v, ok := ctx.Value(sessionKey).(Session) |
| 69 | return v, ok && v != nil |
| 70 | } |
| 71 | |
| 72 | func AuthSessionTo(ctx context.Context, session Session) context.Context { |
| 73 | return context.WithValue(ctx, sessionKey, session) |