// ExtractSession checks whether the session is present and returns it as
// well as user's ID.
ExtractSession checks whether the session is present and returns it as
well as user's ID.
// ExtractSession checks whether the session is present and returns it as // well as user ' s ID .
func ExtractSession(ctx context.Context) (sessionup.Session, xid.ID, error) {
	ses, ok := sessionup.FromContext(ctx)
	if !ok {
		return sessionup.Session{}, xid.ID{}, ErrUnauthorized
	}
	id, err := xid.FromString(ses.UserKey)
	if err != nil {
		return sessionup.Session{}, xid.ID{}, ErrUnauthorized
	}
	return ses, id, nil
}
func ExtractSession ( ctx context . Context ) ( sessionup . Session , xid . ID , error ) { ses , ok := sessionup . FromContext ( ctx ) if ! ok { return sessionup . Session { } , xid . ID { } , ErrUnauthorized } id , err := xid . FromString ( ses . UserKey ) if err != nil { return sessionup . Session { } , xid . ID { } , ErrUnauthorized } return ses , id , nil }
ExtractSession checks whether the session is present and returns it as
well as user's ID.
ExtractSession checks whether the session is present and returns it as well as user ' s ID .